We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 597cd24 commit b9c9ddeCopy full SHA for b9c9dde
doh.py
@@ -10,7 +10,6 @@
10
from urllib import request
11
12
DEFAULT_SERVER = "https://doh.opendns.com"
13
-RR_TYPES = dns.rdatatype._by_text.keys()
14
15
def usage():
16
print("Usage: doh [@[http[s]://]server[:port]] [TYPE] [+nosslverify] domain")
@@ -78,9 +77,12 @@ def main(argv):
78
77
ssl_ctx.verify_mode = ssl.CERT_NONE
79
continue
80
81
- if arg.upper() in RR_TYPES:
82
- record_type = arg.upper()
83
- continue
+ try:
+ if dns.rdatatype.from_text(arg.upper()):
+ record_type = arg.upper()
+ continue
84
+ except:
85
+ pass
86
87
if record_name == "":
88
record_name = arg
requirements.txt
@@ -1 +1 @@
1
-dnspython==1.16.0
+dnspython==2.0.0
0 commit comments