Eryk Sun added the comment: gethostbyname_ex won't do a reverse lookup on an IP to get the fully-qualified domain name, which seems pointless for a function named getfqdn. I think calling gethostbyaddr is intentional here and goes back to the Python 1.x days.
Also, FYI, socket_gethostbyaddr in socketmodule.c doesn't pass a name to C gethostbyaddr. It first calls setipaddr, which calls getaddrinfo to get the IP address. For "docs.python.org", the reverse lookup on the IP address has no data. Well, in Windows the error code is WSANO_DATA; in Linux I get HOST_NOT_FOUND. ---------- nosy: +eryksun _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29533> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com