Network DG834G Custom DNS Servers

From richud.com
Jump to navigation Jump to search

I was trying to get my DGTeam firmware'd DG834G to work with custom DNS servers.

First I tried adding them via "Advanced" > "Advanced DHCP settings", with the "Extended DNS server list"

But there is a bug so that you end up with you device being passed an empty DNS server list if its trying for a DHCP entry before the ADSL lines come up (e.g. you phones on, you then turn the router on, but DHCP gets fulfilled before the line comes up, resulting in no dns server on the phone.)

To get round this, leave it set with "Get Automatically from ISP" and add a script here

"Advanced" > "Custom Setup" > "Enable router ADSL (re)connection custom script execution", add this (yes it needs a real newline)

sed -i '1inameserver 8.8.8.8\
nameserver 208.67.222.222' /etc/resolv.conf

The "Get Automatically from ISP" makes the device only get a DHCP response AFTER the lines up with the router's IP set as the DNS server, then about 30 seconds later the script runs prepending the routers resolv.conf list with your preferred DNS servers.

# cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 208.67.222.222
nameserver 62.24.202.5
nameserver 62.24.243.2

Notice this leaves TalkTalk's extremely slow DNS servers there as backup too.