def revlookupall(name):
    "convenience routine for doing a reverse lookup of an address"
    # FIXME: check for IPv6
    a = name.split('.')
    a.reverse()
    b = '.'.join(a)+'.in-addr.arpa'
    names = dnslookup(b, qtype = 'ptr')
    # this will return all records.
    names.sort(key=str.__len__)
    return names
convenience routine for doing a reverse lookup of an address
python/DNS/lazy.py