(name='')
return name
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 and `name`
    was given, it is returned unchanged. If `name` was empty or '0.0.0.0',
    hostname from gethostname() is returned.
Get fully qualified domain name from name.
Get fully qualified domain name from name .
def getfqdn(name=''):
    """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 and `name`
    was given, it is returned unchanged. If `name` was empty or '0.0.0.0',
    hostname from gethostname() is returned.
    """
    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
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