s4:samba_dnsupdate: don't try to be smart when verifying NS records
authorStefan Metzmacher <metze@samba.org>
Mon, 7 Jul 2014 22:05:03 +0000 (00:05 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 26 Aug 2014 07:13:06 +0000 (09:13 +0200)
We can't rely on the DNS delegation to be correct in the parent domain.
What we really want is to check if we already have registered ourself
as a NS record in our own domain.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9831

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/scripting/bin/samba_dnsupdate

index 9c7c5e232cb62ff329bfe868838f0600bbfb1009..0d001ac9145effd0dd3436dc0e652a0f9882e07b 100755 (executable)
@@ -203,25 +203,6 @@ def check_dns_name(d):
         return False
 
     resolver = dns.resolver.Resolver()
-    if d.type == "NS":
-        # we need to lookup the nameserver for the parent domain,
-        # and use that to check the NS record
-        parent_domain = '.'.join(normalised_name.split('.')[1:])
-        try:
-            ans = resolver.query(parent_domain, 'NS')
-        except dns.exception.DNSException:
-            if opts.verbose:
-                print "Failed to find parent NS for %s" % d
-            return False
-        nameservers = set()
-        for i in range(len(ans)):
-            try:
-                ns = resolver.query(str(ans[i]), 'A')
-            except dns.exception.DNSException:
-                continue
-            for j in range(len(ns)):
-                nameservers.add(str(ns[j]))
-        d.nameservers = list(nameservers)
 
     try:
         if getattr(d, 'nameservers', None):