dnsmasq reverse lookups

As I mentioned earlier, I’ve been using dnsmasq on the NAS device at home to serve up name resolution for my internal network. With a few spare moments to kill, I decided to see if there was a way to configure it to do reverse lookups.

There is.

One of the nice things about dnsmasq is that it will let you use a simple /etc/hosts type file (or an /etc/hosts alone) as its DNS “database”. While that’s convenient, it does have its limitations. For me the main issue was in not being able to do reverse lookups, something that some security software wants to do for obvious reasons.

To add PTR support, open up dnsmasq.conf and add a record like the following someplace before any DHCP section:

ptr-address=5.0.0.10.in-addr,arpa,host.example.com

That’s all there is to it.