def METHOD_NAME(ip):
    addr = reversename.from_address(ip)
    try:
        resp = dns_resolver.query(addr, "PTR")
        ext = tldextract.extract(str(resp[0].target))
        if not ext.suffix:  # invalid PTR record
            raise resolver.NXDOMAIN()
        return (ip, '.'.join((ext.domain, ext.suffix)).lower())
    except (resolver.NXDOMAIN, resolver.YXDOMAIN,
            resolver.NoAnswer, resolver.NoNameservers,
            resolver.Timeout):
        return (None, None)