Using Google Public DNS in conjunction with DD-WRT/DNSMasq
There has been a lot of buzz regarding Google Public DNS herafter called GPD. Google’s instructions are designed for end users modifying their own computers. I think GPD can be very useful if used in conjunction with a forwarding cache on a router. This is the mechanism I used on my Linksys WRT54GL running DD-WRT
v24 to combine using DNSMasq and use GPD’s provided IP addresses 220.127.116.11 and 18.104.22.168 as the upstream DNS.
I assume that you have enabled SSH access to the router so you can login via SSH and take backups of the old values of the upstream DNS
- SSH into your router and run
cat /tmp/resolv.dnsmasq. Save the IP addresses listed somewhere in case you want to revert back
- Go to the Commands tab under Administration.
- In the Commands box paste the following:
- Click Save Firewall (note: your WAN interface will be restarted)
echo "nameserver 22.214.171.124 nameserver 126.96.36.199" > /tmp/resolv.dnsmasq sleep 1 killall -HUP dnsmasq
Now, you can take advantage of the DNS caching on your router and misses on the routers DNS cache are sent to GPD for resolution. Note that websites which use CDN will now determine the closest node based on where the anycasted GPD addresses 188.8.131.52 and 184.108.40.206 resolve to relative to your network.
In a future post, I’ll write about how GPD can be integrated as an upstream forwarder using dnscache and why PowerDNS recursor doesn’t support using an open resolver as an upstream forwarder at present