Archive for September, 2011

DNSMASQ – A lightweight DHCP and caching DNS server

Sunday, September 18th, 2011


I needed to set up a DNS server on my intranet to short cut the loop back that happens when I use the dynamic IP service,, to give my home network an external DNS name.

The name lookup would be from my client computer to my router to my cable modem to the external name server.

The trace route would be from my client computer to my router to my cable modem to the ISP and then back to my modem to my router to the DiskStation.

It’s only fractions of a millisecond (I think), but over millions of packets it would add up.


This open source software is packaged for the Synology DiskStations in all their varieties of CPUs. It was very easy to install using the ipkg system.

Once installed, however, going through the manual reveals a very complicated and powerful application.

After several reads and rereads of the manual, I settled on specifying only one option for DNS: redirecting any call to my DynDNS domain to the DiskStation via the address config option. I also uncommented several config options as recommended in the well documented sample config file, dnsmasq.conf.

It works quite well, now. All lookups of my DynDNS domain name are given the DiskStation’s local IP – 192.168.xx.xx. When I’m away from home and my laptop is not connected to my local network, the lookup is my dynamically assigned IP address from Charter Communications.

I decided to also enable the DHCP server. I did this to be able to better control my IP address leases on my intranet. My Cisco router does a far job, but I felt that since dnsmasq will read a file of IP address/host assignments that would be easier to organize and manage.

However, disabling the DHCP server on the router and switching over that function to the DiskStation and dnsmasq was not without some problems. I had a few misspellings that were easily corrected. The biggest problem was that I was able to get DNS lookups done, but I couldn’t connect to any of the addresses outside my intranet and my router vanished.

The router was obviously working as I could see my DiskStation and other devices on the network, but the router’s web server would not respond. I think it was due to the fact the dnsmasq thinks that the device it is running on is acting as a router, too.

I specified the option dhcp-option=router,xx.xx.xx.xx, but that didn’t seem to fix the problem. I rebooted the client computer, still no joy. Then, out of the blue, it started to connect to the internet address as well as to the router’s web server.

I’m still not sure what happened, but I’m very happy that it is all working now.