I am currently trying to get host information from a user's IP address. I need my program to work with both IPv6 and IPv4. My understanding is that socket.gethostbyaddr(my_ip) should work with both IPv6 and IPv4, but with my code:
host_name = socket.gethostbyaddr(my_ip)
I just get the following error:
socket.herror: [Errno 11004] host not found
It works with IPv4 addresses though, and the IPv6 address I'm using works in all other parts of my program. What gives? I've looked around and found this user Python resolve a host name with IPv6 address had the same issue but it doesn't look like it was ever resolved.
Thank you for reading!