Trevor Sullivan's Tech Room

Minding the gap between administration and development

Tomato Firmware as DNS Server

Posted by Trevor Sullivan on 2010/05/11

If you’re a home user, using the Tomato Firmware on a device, such as the Linksys WRT54GL, and you don’t have an internal DNS server, then Tomato might be able to save the day. For myself, I’ve got several computers on my internal LAN, and do not have an internal DNS server. Each of these computers is running Windows 7 in workgroup mode – as opposed to being an Active Directory domain member (which would require internal DNS). Manually populating the HOSTS file on my Tomato router was not an option, as I am using DHCP all around, and am not interested in the time overhead of manually maintaining a list of device-to-IP mappings.

Since Tomato uses the DNSmasq Linux software, I began investigating how I could go about using it as a DNS server. The manpage for DNSmasq is, as with most manpages, excessively informative. After paging through all the various options, and doing some Googling, I found the “–domain-needed” command line switch. According to the manpage, all I needed to do was append any command line switch to the dnsmasq.conf file, without the “–” prefix, that is normally used on the command line, in order to use this option. Basically, what –domain-needed does, is require that any DNS queries sent to the DNSmasq must be a fully qualified domain name (eg., rather than simply a hostname (eg. “www”). Since I don’t need to resolve hostnames, without domain names, outside of my network, I went ahead and turned this option on. Because DNSmasq also supposedly automatically responds to DNS queries for DHCP-registered hosts, it should now avoid forwarding these hostname-only queries to the configured DNS forwarder, and respond to them directly.

I’ve included a screenshot below of the working DNSmasq configuration in Tomato, as well as a test DNS query using nslookup.exe.

Performing a hostname-only DNS query

Performing a hostname-only DNS query




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: