diff make-tld-conf.py @ 289:6497944a9bd9

update tld.conf, ignore domains with no ns records
author Carl Byington <carl@five-ten-sg.com>
date Fri, 21 Mar 2014 12:36:52 -0700
parents 19ff60eaab74
children 9f0d9fcb58dd
line wrap: on
line diff
--- a/make-tld-conf.py	Fri Mar 21 11:28:51 2014 -0700
+++ b/make-tld-conf.py	Fri Mar 21 12:36:52 2014 -0700
@@ -25,9 +25,13 @@
             if z[-1:] == '-': yy.append(xx)
             else:             yy.append('xn--%s' % z)
         y = '.'.join(yy)
-        if y == x:
+        if not (y == x):
+            f.write('// %s%s\n' % (prefix, x))
+            x = y
+        if not prefix and (len(x.split('.')) == 1):
+            rc = cmd("dig %s ns +short" % x)
+            if not rc:
+                rc = cmd("sleep 3; dig %s ns +short" % x)
+                if not rc: prefix = '// no ns record for '
             f.write('%s%s\n' % (prefix, x))
-        else:
-            f.write('// %s%s\n' % (prefix, x))
-            f.write('%s%s\n' % (prefix, y))
 f.close()