If I have an IP address like 2001:4860:4860::8888
How can I get the fully qualified domain in the format foo.ip6.arpa ?
EDIT: Both the solutions so far give me google-public-dns-a.google.com - maybe Reverse DNS was the wrong name. For this I'd expect the output to be something like 8.8.8.8.0...etc.ip6.arpa
using dnspython.
from dns import resolver,reversename
addr=reversename.from_address("2001:4860:4860::8888")
str(resolver.query(addr,"PTR")[0])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With