Changing the DNS on your Fritzbox

posted on 2013-04-26

I have an internet connection through a Fritz!box 7340. Even though the Fritzbox routers where the better of the bunch, they don't support setting your own DNS. I've found a german blog post explaining it, so I thought I'd describe the process after following that post.

Find out which is faster

First I decided to find out which DNS would work better. There is a tool called namebench which does exactly that. Namebench is probably in your local repository because I only had to do sudo apt-get install namebench.

If you run namebench from the commandline, you will be presented with a TK Gui where you can enter the DNS servers you want to test. I decided to test the Google public DNS vs the DNS provided by XS4All.

First, find out the address of your current DNS by logging into the Fritzbox and looking up the System Log. You should see a line similar to

Internet connection established successfully. IP address: x.x.x.x,
DNS server: 194.109.6.66 and 194.109.9.99, Gateway: 194.109.5.203, Broadband PoP: dr9.d12

This shows you have two DNS servers by XS4All 194.109.6.66 and 194.109.9.99. So I pitted those against the Google public DNS servers 8.8.8.8 and 8.8.4.4.

Turns out 8.8.8.8 is twice as fast as the XS4All DNS servers. Which is weird, because I would expect the XS4All servers to be faster because they are closer on the network. But maybe they run them in a virtual machine or something like that.

Changing the settings

I decided to switch to the Google DNS servers. This German blog describes the whole process:

  • Download the configuration from your Fritzbox
  • Open in a text editor
  • Enter the DNS servers
  • Add a line to bypass the configuration integrity checker
  • Restore the Fritzbox configuration from your backup

Download the configuration from your Fritzbox. It's good to keep a copy of this file before editing, because if you set an incorrect configuration, you will have to reset the router.

Open the FRITZ.Box Fon WLAN 7340 ....export file and find the overwrite_dns1 = 0.0.0.0; and overwrite_dns2 = 0.0.0.0; lines. Change the 0.0.0.0 into the DNS you would like to use. In my case it ended up looking like this:

my_ipaddr = 0.0.0.0;
his_ipaddr = 0.0.0.0;
overwrite_dns1 = 8.8.8.8;
overwrite_dns2 = 8.8.4.4;
bVolumeRoundUp = no;
VolumeRoundUpBytes = 0;

If you would not upload the configuration file to your router, the router would tell you it's broken because the checksum in the file is not correct anymore. To keep the router from checking the config file, add a line with NoChecks=yes just above the **** CFGFILE:ar7.cfg line, as seen in the block below:

OEM=avme
Country=031
Language=en
NoChecks=yes
**** CFGFILE:ar7.cfg
/*
 * /var/flash/ar7.cfg
 * Sun Apr 21 03:05:58 2013
 */

Now upload the configuration to your router. If everything went well, your router will reboot and after logging in you should see a system log line similar to:

Internet connection established successfully. IP address: x.x.x.x,
DNS server: 8.8.8.8 and 8.8.4.4, Gateway: 194.109.5.203, Broadband PoP: dr9.d12

That's it, now your DNS lookups will be faster then ever before.