mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
Improve dns responses parsing
This commit is contained in:
committed by
missytake
parent
d42f579291
commit
61b8dc4637
@@ -73,9 +73,7 @@ def query_dns(typ, domain):
|
||||
|
||||
# Query authoritative nameserver directly to bypass DNS cache.
|
||||
res = shell(f"dig @{ns} -r -q {domain} -t {typ} +short", print=log_progress)
|
||||
if res:
|
||||
return res.split("\n")[0]
|
||||
return ""
|
||||
return next((line for line in res.split("\n") if not line.startswith(';')), '')
|
||||
|
||||
|
||||
def check_zonefile(zonefile, verbose=True):
|
||||
|
||||
Reference in New Issue
Block a user