Browse Source

Fix dns query could throw different kinds of exceptions

Son NK 5 years ago
parent
commit
be1b689463
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/dns_utils.py

+ 1 - 1
app/dns_utils.py

@@ -7,7 +7,7 @@ def get_mx_domains(hostname) -> [(int, str)]:
     """
     try:
         answers = dns.resolver.query(hostname, "MX")
-    except dns.resolver.NoAnswer:
+    except Exception:
         return []
 
     ret = []