Phois
Whois lookup behind proxy using Python
Install / Use
/learn @mirhmousavi/PhoisREADME
Phois
Whois lookup using proxy
Why use Phois over other libraries?
So why use Phois over robust libraries like pythonwhois, pywhois...
-
It supports idn domains.
-
It supports over 1449 tlds (thanks to dnpedia) and if it didn't find any whois server for a specific brand new tld it query
whois.iana.orgto get tld whois server (tlds.jsonfile will be updated when new whois servers fetched). -
It accepts http and socks proxies, thank to
pysocks. -
It accepts user defined whois server to query desired domain.
-
It accepts a timeout for whois operation, some whois servers time out after user quota exceeded.
-
It parses result and if it finds a Registrar whois server, re-whois that server to get complete whois (thick whois).
-
Phois uses
chardetlibrary to detect encoding of whois and give you correctly utf-8 decoded result.
Getting started
Install dependencies
pip install phois
First create a Phois object
p = Phois()
You can set a timeout for whois operation by passing timeout argument, timeout must be an integer <br>
to set proxy just pass proxy_info dict with these arguments<br>
proxy_type: must behttp,socks4orsocks5<br>addr: server ip or address<br>username: proxy username if specified<br>password: proxy password if specified<br>port: proxy port in integer<br>
to fetch whois of domain just call fetch method, this method take two arguments, domain and whois_server
domainis the domain that you want to fetch whois of<br>whois_serveris the whois server that you want to query the domain on that server, if set to None Phois will use the authentic whois server for that domain tld<br> seetestsfor more examples
from phois import *
# without proxy
try:
p = Phois(timeout=10)
result = p.fetch(domain='github.com', whois_server='whois.verisign-grs.com')
# or
result = p.fetch(domain='github.com',)
except Exception as err:
print(str(err))
# with proxy
try:
proxy_info = {'proxy_type':'http','addr':'localhost', 'port':8118}
p = Phois(timeout=10, proxy_info=proxy_info)
result = p.fetch(domain='github.com', whois_server=None,)
except Exception as err:
print(str(err))
- In many cases, when we query registrar whois server, we get full information but sometimes the registry whois sever gives us full information like 'php.guru', so we return both results
Exceptions
BadDomainError
NoWhoisServerFoundError
SocketError
SocketBadProxyError
Related Skills
node-connect
350.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
109.9kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
109.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
350.1kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
