diff -Naur ipwhois-1.2.0.orig/ipwhois/net.py ipwhois-1.2.0/ipwhois/net.py
--- ipwhois-1.2.0.orig/ipwhois/net.py	2020-09-18 02:39:53.000000000 +0800
+++ ipwhois-1.2.0/ipwhois/net.py	2021-11-11 08:16:51.177848259 +0800
@@ -126,6 +126,11 @@
         self.timeout = timeout
 
         self.dns_resolver = dns.resolver.Resolver()
+        if hasattr(self.dns_resolver, "resolve"):
+            self.dns_resolve = getattr(self.dns_resolver, "resolve")
+        else:
+            self.dns_resolve = getattr(self.dns_resolver, "query")
+
         self.dns_resolver.timeout = timeout
         self.dns_resolver.lifetime = timeout
 
@@ -220,7 +225,7 @@
         try:
 
             log.debug('ASN query for {0}'.format(self.dns_zone))
-            data = self.dns_resolver.query(self.dns_zone, 'TXT')
+            data = self.dns_resolve(self.dns_zone, 'TXT')
             return list(data)
 
         except (dns.resolver.NXDOMAIN, dns.resolver.NoNameservers,
@@ -262,7 +267,7 @@
         try:
 
             log.debug('ASN verbose query for {0}'.format(zone))
-            data = self.dns_resolver.query(zone, 'TXT')
+            data = self.dns_resolve(zone, 'TXT')
             return str(data[0])
 
         except (dns.resolver.NXDOMAIN, dns.resolver.NoNameservers,
diff -Naur ipwhois-1.2.0.orig/setup.py ipwhois-1.2.0/setup.py
--- ipwhois-1.2.0.orig/setup.py	2020-09-18 02:39:53.000000000 +0800
+++ ipwhois-1.2.0/setup.py	2021-11-11 08:17:06.050847450 +0800
@@ -67,7 +67,7 @@
 
 PACKAGE_DATA = {'ipwhois': ['data/*.xml', 'data/*.csv']}
 
-INSTALL_REQUIRES = ['dnspython<=2.0.0', 'ipaddr==2.2.0;python_version<"3.3"']
+INSTALL_REQUIRES = ['dnspython<=3.0.0', 'ipaddr==2.2.0;python_version<"3.3"']
 
 setup(
     name=NAME,
