Server names in Dnsmasq

My domain name service (DNS) is running on a router using the wonderful Tomato firmware. When a computer boots up, it sends its hostname (i.e. “sally”) to the router, which records the hostname and returns the corresponding IP (“”).

This is all grand. But, what if different services require a computer to have multiple names? That is, when the Puppet service fires up on my lappytop, it looks for the hostname “puppet” by default. Given the above scheme, a computer has one and only one name; DNS doesn’t know that “sally” is also known as “puppet”.

Here’s how to fix that. The router is running Tomato, which uses Dnsmasq as the DNS service. It automatically figures out the normal hostname/IP mapping, for instance “sally” in the above example. We can tell it to point other names, like “puppet”, to individual IP addresses.

Open up the Tomato administration page. Click Advanced / DHCP-DNS, and paste this into the Custom Configuration block after enabling all three checkboxes:



# service names, these are in addition to /etc/hostname
# for each computer:

To test:

$ ping -c1 puppet
PING puppet.lan ( 56(84) bytes of data.
64 bytes from spootoxin.lan ( icmp_seq=1 ttl=64 time=0.077 ms

--- puppet.lan ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.077/0.077/0.077/0.000 ms

Notice the system translates “puppet” to “puppet.lan” — these are different names! The results for “dig puppet” and “ping puppet” can be different.

Check /etc/resolv.conf :

domain lan
search lan

Thanks to for the tip!