I want to run a couple of apache virtual websites at my Ubuntu 14.04LTS laptop. It has not bind/named installed but to my surprise in /etc/resolv.conf there is a reference to 127.0.0.1. It means something bind like is running at my machine. It turned out to be dnsmasq! It has been installed along with Ubuntu Network Manager.

Dnsmasq indeed is a cache and it has quite powerfull capabilities like defining local DNS entries in /etc/hosts and return them as DNS responses. This is exactly what I wanted. This way I could run a list of local sities with apache httpd. Unfortunately when dnsmasq is called by NetworkManager, it by default ignores /etc/hosts and there is no configuration to be tuned.

After a short digging in the web, I found a dirty hack which replaces dnsmasq binary with a script and this way allows to consider entries from /etc/hosts to be valid DNS records. The other option is to get dnsmasq out of NetworkManager control and install it independently.

Both solutions are described here.

Further Reading

  1. help.ubuntu.com on Dnsmasq
  2. Dnsmasq FAQ