Her is one dnsmasq config file ....
dnsmasq only serves on the eth0 interface in this example. If you don't specify then it uses all interface (not appropriate for a routers WAN interface.
The resolv-file line is unneeded if you have no inet access. Otherwise it passes unresolved names onto an upstream DNS server. The file looks like an /etc/resolv.conf file where only the nameserver lines are used. This is a list of google DNS servers ....
This is the domain name. Unless you pay for an inet domain don't make one up. 'localdomain' is safe for use.
This says 192.168.42.1 is the gateway. If you have no inet access then use 0.0.0.0, or delete this line.
This should be used if this is the only DHCP server on the LAN.
This says the dnsmasq also serves IP addresses via DHCP, and range of addresses is 192.168.42.100...192.168.42.127 with a mask of 255.255.255.0 and a lease time of 99999 minutes.
These dhcp-host lines give fixed
IP addresses to some MAC address devices. Also dnsmasq reads the /tc/hosts for fixed IP assignments and serves this to other systems.
If you dhcp to this server to get an IP address, AND your hostname is setup, then the dnsmasq server will give you a /etc/resolv.conf like this:
$ cat /etc/resolv.conf
# Generated by NetworkManager
And when you get the IP address via NetworkManager then the DNSmasq server will record the `hostname`.localdomain to the IP address. So you don't need to give each system a fixed IP address.
If you use 'network' instead of 'NetworkManager' then you will need to modify the client /etc/sysconfig/network-scripts/ifcfg-eth0 (or other interface name) and add a line like ...
and then when the dhcp takes place, the client passes it's hostname (hypoxylon.localdomain in this example) to the dnsmasq dns server.
If you use one of the fixed names above or one of the dynamically recorded names from dhcp - then the dnsmasq dns server replies with the correct IP so for example
[stevea@crucibulum ~]$ ping chumby
PING chumby.localdomain (192.168.42.21) 56(84) bytes of data.
64 bytes from chumby.localdomain (192.168.42.21): icmp_req=1 ttl=64 time=56.4 ms
64 bytes from chumby.localdomain (192.168.42.21): icmp_req=2 ttl=64 time=3.27 ms
[stevea@crucibulum ~]$ ping hypoxylon
PING hypoxylon.localdomain (192.168.42.103) 56(84) bytes of data.
64 bytes from hypoxylon.localdomain (192.168.42.103): icmp_req=1 ttl=64 time=2.30 ms
64 bytes from hypoxylon.localdomain (192.168.42.103): icmp_req=2 ttl=64 time=207 ms
If that's not clear. please ask.