The whois command uses getaddrinfo to perform a domain name resolution on the NIC server. This may cause errors in mistakenly registered domains and cause whois.query() to break.
Ignoring the return code allows you to retrieve the previously parsed information. E.g. (on a Rocky Linux 9.1)
>>> import whois
>>> q = whois.query('deamsa.com')
...
whois.exceptions.WhoisCommandFailed: getaddrinfo(https://www.arsys.es/dominios/whois): Name or service not known
...
>>> q = whois.query('deamsa.com', ignore_returncode=True)
>>> q.creation_date
datetime.datetime(2000, 1, 31, 9, 43, 41)
>>> q.registrar
'Arsys Internet, S.L. dba NICLINE.COM'
The
whois
command usesgetaddrinfo
to perform a domain name resolution on the NIC server. This may cause errors in mistakenly registered domains and causewhois.query()
to break.Ignoring the return code allows you to retrieve the previously parsed information. E.g. (on a Rocky Linux 9.1)