Get fully qualified domain name from name.
An empty argument is interpreted as meaning the local host.
First the hostname returned by gethostbyaddr() is checked, then
possibly existing aliases. In case no FQDN is available, hostname
is returned.
Definition at line 91 of file socket.py.
93 """Get fully qualified domain name from name.
95 An empty argument is interpreted as meaning the local host.
97 First the hostname returned by gethostbyaddr() is checked, then
98 possibly existing aliases. In case no FQDN is available, hostname
102 if not name
or name ==
'0.0.0.0':
105 hostname, aliases, ipaddrs = gethostbyaddr(name)
109 aliases.insert(0, hostname)