Home > General > Using Google Public DNS in conjunction with DD-WRT/DNSMasq

Using Google Public DNS in conjunction with DD-WRT/DNSMasq

December 5, 2009

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 8.8.8.8 and 8.8.4.4 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

  1. SSH into your router and run cat /tmp/resolv.dnsmasq . Save the IP addresses listed somewhere in case you want to revert back
  2. Go to the Commands tab under Administration.
  3. In the Commands box paste the following:
  4. echo "nameserver 8.8.8.8
    nameserver 8.8.4.4" > /tmp/resolv.dnsmasq
    sleep 1
    killall -HUP dnsmasq
    
  5. Click Save Firewall (note: your WAN interface will be restarted)

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 8.8.8.8 and 8.8.4.4  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

Advertisement
Categories: General Tags: , ,
  1. December 6, 2009 at 6:20 am

    Interesting article, thanks for posting

  1. December 6, 2009 at 5:24 am
Comments are closed.
%d bloggers like this: