diff make-tld-conf.py @ 300:3a3b0cbcaf6e

update tld.conf for new zones
author Carl Byington <carl@five-ten-sg.com>
date Mon, 13 Oct 2014 13:55:21 -0700
parents 9f0d9fcb58dd
children c8144da09419
line wrap: on
line diff
--- a/make-tld-conf.py	Mon Oct 13 13:37:31 2014 -0700
+++ b/make-tld-conf.py	Mon Oct 13 13:55:21 2014 -0700
@@ -3,6 +3,7 @@
 import os, sys, time
 
 def cmd(c):
+    print c
     return os.popen(c).read().rstrip('\n')
 
 url = 'https://publicsuffix.org/list/effective_tld_names.dat'
@@ -29,9 +30,9 @@
             f.write('// %s%s\n' % (prefix, x))
             x = y
         if not prefix and (len(x.split('.')) == 1):
-            rc = cmd("dig %s ns +short" % x)
+            rc = cmd("dig %s ns +short 2>&1" % x)
             if not rc:
-                rc = cmd("sleep 3; dig %s ns +short" % x)
+                rc = cmd("sleep 3; dig %s ns +short 2>&1" % x)
                 if not rc: prefix = '// no ns record for '
         f.write('%s%s\n' % (prefix, x))
 f.close()