Python 2.7.1 (perhaps others) I believe this is a bug. Comments?
Docs state: Return a triple (hostname, aliaslist, ipaddrlist) where hostname is the primary host name responding to the given ip_address, aliaslist is a (possibly empty) list of alternative host names for the same address, and ipaddrlist is a list of IPv4/v6 addresses for the same interface on the same host (most likely containing only a single address). my-dns-cname.our.org is a CNAME record for primary.our.org primary.our.org has IP address xx.xx.xx.xx import socket socket.gethostbyaddr('xx.xx.xx.xx') returns: ('my-dns-cname.our.org', ['primary.our.org'], ['xx.xx.xx.xx']) -- http://mail.python.org/mailman/listinfo/python-list