添加无有效解析结果处理

This commit is contained in:
Jing Ling
2020-04-27 11:01:07 +08:00
parent 2c883fad50
commit 06c4f141d5
2 changed files with 7 additions and 2 deletions
+3 -1
View File
@@ -16,7 +16,6 @@ import secrets
import exrex
import fire
import tenacity
from tenacity import RetryError
from dns.exception import Timeout
from dns.resolver import NXDOMAIN, YXDOMAIN, NoAnswer, NoNameservers
@@ -361,6 +360,9 @@ def deal_output(output_path, ip_times, wildcard_ips, wildcard_ttl):
records, subdomains = gen_records(items, records, subdomains,
ip_times, wildcard_ips,
wildcard_ttl)
if not records:
logger.log('FATAL', f'无有效解析结果')
exit(1)
return records, subdomains
+4 -1
View File
@@ -121,7 +121,10 @@ def deal_output(output_path):
record['resolve'] = 0
record['reason'] = 'NOARECORD'
records[qname] = record
return records
if not records:
logger.log('FATAL', f'无有效解析结果')
exit(1)
return records
def run_resolve(domain, data):