python-doh
python-doh copied to clipboard
query returns IPv6 hostname, not IPv6 address.
In the following bug, the call to the python function query("mail.google.com") returns the IPv6 hostname (googlemail.l.google.com) and the IPv4 address, instead of the IPv6 address (2607:f8b0:4009:802::2005) and the IPv4 address (172.217.4.37):
~/python-doh# python
Python 2.7.9 (default, Sep 14 2019, 20:00:08)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import client
>>> print(client.query("one.one.one.one"))
['1.0.0.1', '1.1.1.1']
>>> print(client.query("cnn.com"))
['151.101.1.67', '151.101.65.67', '151.101.129.67', '151.101.193.67']
>>> print(client.query("mail.google.com"))
['googlemail.l.google.com.', '172.217.4.37']
>>> print(client.query("googlemail.l.google.com"))
['172.217.4.37']
>>> exit()
~/python-doh# nslookup
> mail.google.com
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
mail.google.com canonical name = googlemail.l.google.com.
Name: googlemail.l.google.com
Address: 172.217.4.101
Name: googlemail.l.google.com
Address: 2607:f8b0:4009:802::2005
> exit