http://www.thekelleys.org.uk/dnsmasq/doc.html
I do the following.
Normally the local machine queries /etc/resolv.conf for DNS servers. dnsmasq in turn queries resolv.conf for it's dns servers and can serve clients on the LAN their DNS/DHCP requests
I want the machine running dnsmasq also to be a client of the local dnsmasq server to give it the ability to ping by name any IP address served by it's DHCP. So I change the setup as follows.
mv /etc/resolv.conf /etc/resolv.conf-dnsmasq
edit /etc/dnsmasq.conf so that it uses the /etc/resolv.conf-dnsmasq for it's upstream servers
make the local machine query itself which means it will serve the IP Addresses of the DHCP clients
echo nameserver 127.0.0.1 > /etc/resolv.conf
run system-config-network and turn off the ADSL connection from getting it's DNS servers via DHCP (so it doesn't overwrite my custom /etc/resolv.conf)
contents of /etc/dnsmasq.conf
resolv-file=/etc/resolv.conf-dnsmasq
local=/localnet/
local=/jmcd.local/
interface=eth0
expand-hosts
domain=jmcd.local
dhcp-range=10.X.X.X,10.X.X.Y,255.255.255.0,12h
dhcp-option=3,10.X.X.X
conf-dir=/etc/dnsmasq.d
0 Comments