Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

(adapted from the dnsmasq mailing list which archive seems to be down so I am not sure it is still active)


I set up dnsmasq on my home network to replace the isc/bind legacy system :) when changing the architecture. The setup relies on a debian box which acts as the router/firewall/"master of all truth" (DNS, ntp, ...):

  • an ADSL access to Internet with the public IP assigned to eth1
  • a wired network bound to eth0 (which has the address)
  • a wired network bound to wlan3 (which has the address)
  • the domain name for the internal network is "home"
  • firewalling is handled by shorewall

The dnsmasq configuration is:

dhcp-option=19,0           # option ip-forwarding off
dhcp-option=44,     # set netbios-over-TCP/IP nameserver(s) aka
WINS server(s)
dhcp-option=45,     # netbios datagram distribution server
dhcp-option=46,8           # netbios node type

What works:

  • clients in the subnets (both wired and wireless) get IP addresses via DHCP in the expected ranges
  • external (Internet = forwarded) DNS resolution works for these clients and for the server

What does not work:

  • the "home" domain name does not seem to be correclty handled. /etc/hosts has a server.home entry which is not apparently used by dnsmasq, i.e. dig server does not return the name, dig server.home does not either.
  • I did not manage to send a name resolution dependent on the network it is sent to. Namely the serverentry avove should ideally be pointing to for the wired and for the wireless network. The setup today works but is not really correct (the traffic to the server from the wireless network reaches the server through the wired interface).

I am sure that this is something obvious but I am brand new to dnsmasq and would appreciate very much any pointers. There was a similar question some time ago but the accepted answer would suggest that dnsmasq is not handling these basic requirements (local domain, PTR updates) properly (?)

Thank you

share|improve this question
up vote 3 down vote accepted

I finally solved the first and key problem by:

  • copying /etc/resolv.conf to /etc/resolv.dnsmasq
  • setting only one nameserver line in /etc/resolv.conf
  • in /etc/dnsmasq.conf I added resolv-file=/etc/resolv.dnsmasq

This forces the server to resolve DNS names on the local DNS ...

... which is dnsmasq ...

... which uses upstream servers defined in /etc/resolv.dnsmasq

The second problem remains but it is of lesser importance.

share|improve this answer
Thanks to Simon Kelley (the author od dnsmasq) the second problem is solved as well: localise-queries must be added to the dnsmasq configuration file (details are in man dnsmasq) – WoJ Jul 29 '12 at 18:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .