- Published on
DNSmasq - quick and dirty DNS for LAN
- Authors

- Name
- Martin Andrews
- @mdda123
The Situation
Simple network within the company :
- Fortinet NAT/router
- Windows XP clients around room
- Linux server (serving via Samba, potentially NFS)
I just want to name a few machines, to avoid typing in IPs all the time.
On the Server machine
# yum remove caching-nameserver
# yum install dnsmasq
Edit /etc/dnsmasq.conf, enable :
domain-needed
bogus-priv
local=/fscapital/ # For LAN addresses like server.fscapital
cache-size=1500
resolv-file=/etc/resolv-tw.conf # so that localhost also uses dnsmasq
- Into :
/etc/host.conf:
file: "order hosts,bind"
[root@fscapital intranet]# more /etc/resolv.conf
nameserver 127.0.0.1
[root@fscapital intranet]# more /etc/resolv-tw.conf
nameserver 24.29.xx.y6
nameserver 24.29.xx.y5
After every change to /etc/hosts need to do :
# /etc/init.d/dnsmasq restart
On the Client machines
# more /etc/host.conf
order hosts,bind
# more /etc/resolv.conf
; generated by /sbin/dhclient-script
; nameserver 192.168.10.1
nameserver 192.168.10.120
domain fscapital
On the Router
All requests across the network (whether DHCP referred or not) go to the gateway IP.
Set the Fortinet to use the Server for DNS requests (this should forward the requests to our new DNSmasq server).
man page : http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html