dnsmasq works with various sources to provide resolving domain names on your local network. It is capable of using /etc/hosts, /etc/resolv.conf, additional resolv.conf files created by other applications like ppp, acting as secondary DNS in addition to primary DNS and is well integrated with the dhcpd part of dnsmasq.
Again we advise you to read the configuration file carefully, to understand how dnsmasq integrates into your network. We will describe a few standard settings for a basic LEAF image setup.
The first decision you have to make, is wether you like to use your own resolv.conf, or one created by an another application (see below ).
# Change this line if you want dns to get its upstream servers from # somewhere other that /etc/resolv.conf #resolv-file=
In case you use your own /etc/resolv.conf, leave this as is.
If you want dnsmasq to resolve your local and private domain as well (either from /etc/hosts or dhcp) set your domain as local
# Add local-only domains here, queries in these domains are answered # from /etc/hosts or DHCP only. local=/private.network/
Next choose the interface(s) dnsmasq should listen - the one connected your LAN. In a simple LEAF setup it is usually eth1.
# If you want dnsmasq to listen for requests only on specified interfaces # (and the loopback) give the name of the interface (eg eth0) here. # Repeat the line for more than one interface. interface=eth1
If you have more than one interface connected to local LAN's you may define the interface not to listen on - the interface to the Internet:
# Or you can specify which interface _not_ to listen on except-interface=eth0
At last you should configure to expand hostnames in your LAN and your domain:
# Set this (and domain: see below) if you want to have a domain # automatically added to simple names in a hosts-file. expand-hosts # Set the domain for dnsmasq. this is optional, but if it is set, it # does the following things. # 1) Allows DHCP hosts to have fully qualified domain names, as long # as the domain part matches this setting. # 2) Sets the "domain" DHCP option thereby potentially setting the # domain of all systems configured by DHCP # 3) Provides the domain part for "expand-hosts" domain=private.network
For debugging purposes you can enable "log-queries" at the end of dnsmasq.conf.
Now you're nearly done with a default setup. Read on in one of the following section best describing your Internet connection.