I’m intrigued by the concept of Alternative DNS roots, why not have access to all of the internet that you can? But there are a handful and they all want you to use only them as your only DNS server, and I don’t like that much (I prefer OpenDNS, which I use encrypted). So I wrote a little python script to spit out a configuration file that dnsmasq can use to only query the servers that provide the TLDs that you want to access.
Many (most?) home routers use dnsmasq too, so you can paste the output of this program into it as well to instantly get you access to all of these other domain names.
#!/usr/bin/python3
import subprocess
import sys
def getTLDS(command):
process = subprocess.Popen(['bash', '-c', command], stdout=subprocess.PIPE)
stdout, stderr = process.communicate()
return stdout.decode(sys.stdout.encoding).split('\n')
class TLDEntry:
name = ''
tlds = []
ns = []
def __init__(self, name, tlds, ns):
self.name = name
self.tlds = tlds
self.ns = ns
tldEntries = []
# OpenNIC, opennicproject.org
tldEntries.append(TLDEntry('OpenNIC', ['bbs', 'dyn', 'free', 'fur', 'geek', 'opennic.glue', 'gopher', 'indy', 'ing', 'micro', 'null', 'oss', 'parody'], ['66.244.95.20', '128.173.89.246']))
# NameCoin P2P DNS, dot-bit.org
tldEntries.append(TLDEntry('NameCoin', ['bit'], ['216.231.140.69', '178.32.31.41']))
# NewNations, new-nations.net
tldEntries.append(TLDEntry('NewNations', ['ko', 'ku', 'rm', 'te', 'ti', 'uu'], ['88.84.130.20', '194.50.176.206']))
# Name.Space, namespace.us
tldEntries.append(TLDEntry('Name.Space', getTLDS('wget --no-check-certificate -q -O- https://namespace.us/CompleteTLDList.pdf | pdftotext - - | grep "^\." | sed "s/^.//"'), ['209.48.2.16', '184.74.208.107', '209.48.4.2', '184.74.208.109']))
# Cesidian ROOT, cesidianroot.net
tldEntries.append(TLDEntry('Cesidian ROOT', getTLDS('wget -q -O- http://www.cesidianroot.net/ | grep "\.[^;]*<br>" | grep -v "\.<br>" | grep -o "\.[^<]*" | sed "s/^.//"'), ['50.77.217.162', '69.93.127.50', '68.71.240.36']))
duplicates = dict()
for tldEntry in tldEntries:
print("\n#", tldEntry.name)
for tld in tldEntry.tlds:
if len(tld) < 1:
continue
if tld in duplicates:
print("# tld '.%s' of '%s' is a duplicate of '%s'" % (tld, tldEntry.name, duplicates.get(tld)))
continue
duplicates.setdefault(tld, tldEntry.name)
prepend = 'server='
for ns in tldEntry.ns:
print('%s/%s./%s' % (prepend, tld, ns), end='')
prepend = ','
print()
You can output this to a new file, and add this in your dnsmasq.conf if you like:
conf-file=/etc/dnsmasq_alt.conf
Attached is the output, as long as you want to use the same DNS servers I use (if you don’t live in the US, you may want to change some of them).