def getfqdn(name=''):
    name = name.strip()
    if not name or name == '0.0.0.0':
        name = gethostname()
    try:
        hostname, aliases, ipaddrs = gethostbyaddr(name)
    except error:
        pass
    else:
        aliases.insert(0, hostname)
        for name in aliases:
            if '.' in name:
                break
        else:
            name = hostname
    return name
Get fully qualified domain name from name.
dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/python/Lib/socket.py/getfqdn