Accept NoAnswer as a valid DNS response
This commit is contained in:
parent
ccec8faff6
commit
9d18f665c5
@ -44,7 +44,7 @@ def resolve_ip(domain, query_type):
|
|||||||
# Resolve domain name using Cloudflare Public DNS
|
# Resolve domain name using Cloudflare Public DNS
|
||||||
try:
|
try:
|
||||||
return resolver.query(domain, query_type)[0].address
|
return resolver.query(domain, query_type)[0].address
|
||||||
except dns.resolver.NXDOMAIN:
|
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def ping_url(url):
|
def ping_url(url):
|
||||||
|
Loading…
Reference in New Issue
Block a user