adding dns tests and assorted exception handling

This commit is contained in:
csine-nflx
2020-01-31 13:16:37 -08:00
parent 969a7107fe
commit be7736d350
4 changed files with 25 additions and 16 deletions

View File

@ -6,8 +6,7 @@ import dns.query
import dns.resolver
import re
from flask import current_app
from lemur.extensions import metrics, sentry
from lemur.extensions import metrics
class DNSError(Exception):
@ -86,9 +85,6 @@ def get_authoritative_nameserver(domain):
def get_dns_records(domain, rdtype, nameserver):
"""Retrieves the DNS records matching the name and type and returns a list of records"""
# if not nameserver:
# nameserver = get_authoritative_nameserver(domain)[0]
records = []
try:
dns_resolver = dns.resolver.Resolver()