From 6ac89bb9980773a498765b6b6a0fbb47ae72f366 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Tue, 2 May 2017 02:51:49 +0200 Subject: [PATCH] Abort DNS check if no nameservers are configured for the domain --- api/dnshelper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/dnshelper.py b/api/dnshelper.py index 56c0195..c2872ad 100644 --- a/api/dnshelper.py +++ b/api/dnshelper.py @@ -51,6 +51,9 @@ def dnsQuery(domain, rrType, nameserverIp): def checkDomain(domain, tldNameserver, nameservers): result = [] + if nameservers.count() == 0: + return [("err", "Domain %s has no nameservers attached to it, nothing to check" % domain)] + # build record set nsRecords = [(domain, "NS", list(ns.name for ns in nameservers))] glueRecords = []