def test ( ) : dns = ReverseDNS ( ) print ( dns . lookup ( '192.168.0.1' ) ) print ( dns . lookup ( '8.8.8.8' ) ) # Test cache print ( dns . lookup ( '8.8.8.8' ) )
question 2what python function is used to perform a dns lookup
Test for ReverseDNS class
def test():
    """Test for ReverseDNS class"""
    dns = ReverseDNS()

    print(dns.lookup('192.168.0.1'))
    print(dns.lookup('8.8.8.8'))

    # Test cache
    print(dns.lookup('8.8.8.8'))