DNSMASQ – home network changes

Desided to make some changes to the home network using dnsmasq. dnsmasq is a light weight dns cache/dhcp/tftp server that is easy to configure and manage and does not require a large footprint as far as memory or cpu.

In my home network I have a main router which acted as a wireless access point and dhcp server which plugs into my MOCA network and to the gigE switch for the wired machines. I have another wireless AP on the MOCA network to extend my wireless footprint.

dnsmasq pretty much works right out of the box however I wanted to add some specific settings.

DNS cache – with some ad blocking
used the services from yoyo.org to create a block list of sites in dnsmasq format and update it weekly onto /etc/dnsmasq.d with a simple cronjob.

wget -O /etc/dnsmasq.d/ad-block-list “http://pgl.yoyo.org/adservers/serverlist.php?hostformat=dnsmasq&showintro=0&startdate%5Bday%5D=&startdate%5Bmonth%5D=&startdat

this will help to block spam/ad sites and ads from appearing in various sites and also stop most popups.

DHCP Server
dnsmasq allows you to bundle DHCP server with the same daemon. so i’ve moved the DHCP server from the main router to this server and set my router to DHCP relay. DHCP server within dnsmasq is actually pretty robust and feature rich and the following was the config i’ve used


you can also set static IP’s via DHCP by using the following :

Lastly you can add dns entries for your non routable servers using :

the config lines are pretty self explanatory but if you want more details you can always view the man pages.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.