diff --git a/modules/dns.py b/modules/dns.py index 8a6e9ae..0cc4630 100644 --- a/modules/dns.py +++ b/modules/dns.py @@ -23,7 +23,7 @@ def dnsrec(domain, output, data): 'TA', 'TKEY', 'TLSA', 'TSIG', 'TXT', 'URI', 'ZONEMD'] full_ans = [] - res = dns.asyncresolver.Resolver() + res = dns.asyncresolver.Resolver(configure=False) res.nameservers = ['1.1.1.1', '1.0.0.1', '8.8.8.8', '8.8.4.4', '9.9.9.9', '149.112.112.112'] @@ -41,6 +41,8 @@ async def fetch_records(res, domain, record): log_writer(f'[dns] Exception = {exc}') except dns.resolver.NoMetaqueries as exc: log_writer(f'[dns] Exception = {exc}') + except dns.resolver.NoNameservers as exc: + log_writer(f'[dns] Exception = {exc}') except dns.resolver.NXDOMAIN as exc: log_writer(f'[dns] Exception = {exc}') print(f'{R}[-] {C}DNS Records Not Found!{W}') @@ -58,11 +60,11 @@ async def fetch_records(res, domain, record): try: dmarc_ans = asyncio.run(fetch_records(res, dmarc_target, 'TXT')) for entry in dmarc_ans: - print(f'{C}DMARK \t: {W}{entry.to_text()}') + print(f'{C}DMARC \t: {W}{entry.to_text()}') if output != 'None': - result.setdefault('dmarc', []).append(f'DMARK : {entry.to_text()}') + result.setdefault('dmarc', []).append(f'DMARC : {entry.to_text()}') except dns.resolver.NXDOMAIN as exc: - log_writer(f'[dns.dmark] Exception = {exc}') + log_writer(f'[dns.dmarc] Exception = {exc}') print(f'\n{R}[-] {C}DMARC Record Not Found!{W}') if output != 'None': result.setdefault('dmarc', ['DMARC Record Not Found!'])