comparison 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
comparison
equal deleted inserted replaced
288:8a18f01a4747 289:6497944a9bd9
23 y = unicode(xx, 'utf8') 23 y = unicode(xx, 'utf8')
24 z = y.encode('punycode') 24 z = y.encode('punycode')
25 if z[-1:] == '-': yy.append(xx) 25 if z[-1:] == '-': yy.append(xx)
26 else: yy.append('xn--%s' % z) 26 else: yy.append('xn--%s' % z)
27 y = '.'.join(yy) 27 y = '.'.join(yy)
28 if y == x: 28 if not (y == x):
29 f.write('%s%s\n' % (prefix, x))
30 else:
31 f.write('// %s%s\n' % (prefix, x)) 29 f.write('// %s%s\n' % (prefix, x))
32 f.write('%s%s\n' % (prefix, y)) 30 x = y
31 if not prefix and (len(x.split('.')) == 1):
32 rc = cmd("dig %s ns +short" % x)
33 if not rc:
34 rc = cmd("sleep 3; dig %s ns +short" % x)
35 if not rc: prefix = '// no ns record for '
36 f.write('%s%s\n' % (prefix, x))
33 f.close() 37 f.close()