-
Notifications
You must be signed in to change notification settings - Fork 6
Old DNS setup (djbdns)
The old DNS structure was as follows
Every VPN node has a BIND instance that forwards dns queries to our DNS external DNS caches, that are running dnscache and djbdns.- VPN nodes dish out dns-cache0.lokun.is and dns-cache1.lokun.is as DNS caches for the clients via DHCP.
-
huginn.utrad.isandmuninn.utrad.iswere used as dns resolvers forlokun.is.
This is being phased out now at the time of writing (Feb 2015)
-
Install
build-essentialwith apt
```
-
Install djbdns
# wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz # tar xzvf djbdns-1.05.tar.gz # cd djbdns-1.05 # echo gcc -O2 -include /usr/include/errno.h > conf-cc # make # make setup check -
Create users for
dnscache# useradd dnscache # useradd dnslog -
Create the
/etc/dnscachedirectory# dnscache-conf dnscache dnslog /etc/dnscache <ip> -
Add the script that maintains the list of allowed ips to
/etc/rc.localand/or a daily/hourly cronjob, then run it. I put it in/srv# apt-get install python-pip python-dev # pip install requests netifaces # python dnscache-iplist.pyNote that this adds the local IP of the cache server to
/etc/dnscache/root/ip, otherwise it won't work. -
Install
daemontoolsanducspi-tcpwith apt and add dnscache# apt-get install daemontools ucspi-tcp daemontools-run # ln -s /etc/dnscache /etc/service/dnscache -
To disable logging, edit the file
/etc/dnscache/run. Simply prevent stdout from reaching multilog by changing the lineexec 2>&1to
exec 1>/dev/null 2>&1Logging is useful for debugging though. I tried sending a
HUPto the multilog and run process, but ultimately only rebooting worked. -
Set up tinydns for overriding
# useradd tinydns # tinydns-conf tinydns dnslog /etc/tinydns-override 127.0.0.1 # ln -s /etc/tinydns-override /etc/service/tinydns-overrideAnd then daemontools picks it up.
-
Add the DNS records
tinydnsdata file,/etc/tinydns-override/root/data.netflix.com:96.47.231.242:ns:300 +netflix.com:96.47.231.242:300 +*.netflix.com:96.47.231.242:300 .hulu.com:96.47.231.242:ns:300 +hulu.com:96.47.231.242:300 +*.hulu.com:96.47.231.242:300 .huluim.com:96.47.231.242:ns:300 +huluim.com:96.47.231.242:300 +*.huluim.com:96.47.231.242:300
Where 96.47.231.242 is a proxy server. This file will be automatically generated.
-
cdinto/etc/tinydns-override/root/and# make
tinydns is now updated.
-
Tell
dnscacheto consult our localtinydns-overridefor these domains# echo 127.0.0.1 > /etc/dnscache/root/servers/netflix.com # echo 127.0.0.1 > /etc/dnscache/root/servers/huluim.com # echo 127.0.0.1 > /etc/dnscache/root/servers/hulu.com # echo 127.0.0.1 > /etc/dnscache/root/servers/pandora.com # echo 127.0.0.1 > /etc/dnscache/root/servers/foodnetwork.com -
Send the dnscahce process a
HUPsignal to make it reload this configuration.