DNS
From Admin-SIG
Frankly, I have always found bind very frustrating. So... If somebody wants to put some pointers about bind here, please do so. This is where they belong.
dnsmasq
dnsmasq is a very simple replacement for DNS (and DHCP) which is just perfect for the small networks that many of us have in our homes or small offices these days. It is designed for the case where you work on a small private network (192.168. or 10.) which are often set up by DSL and Cable Modems.
Just install it and edit /etc/dnsmasq.conf. Its well commented, and pretty easy to understand.
Here are some tips:
- Use /etc/hosts as your master local-net DNS file.
- Point your /etc/resolv.conf to nameserver 127.0.0.1, but put server=/realDNSserverName/116.21.54.67 in the dnsmasq.conf file
Here's a setup where dnsmasq is cacheing DNS for a comcast modem, which seems to do DNS relay, but no cacheing.
/etc/resolv.conf:
domain mylocal.net nameserver 127.0.0.1 nameserver 10.1.10.2 nameserver 10.1.10.1
The LINUX server is 10.1.10.2, and the comcast modem is 10.1.10.1. For some reason, which I do not recall, having the two paths to the same machine was necessary. Perhaps that dnsmasq passes on the last two nameserver entries to clients via dhcp. Hence the 10.1.10.2 entry was necessary so that clients look to our cacheing server before trying the non-cacheing modem.
All the local machine names and their STATIC IP's are recorded as usual in /etc/hosts. The dnsmasq daemon will interpret this and resolve local net DNS queries. I have made these local DNS names match the Windows networking names for windows clients and samba servers.
The main changes I have in /etc/dnsmasq.conf are these changes and additions:
# next upstream DNS server: server=10.1.10.1 # # put DYNAMIC PC addresses in this range, with a 999 hour lease... dhcp-range=10.1.10.50,10.1.10.150,999h # # Let STATIC windows hosts get their IP from /etc/hosts. # The host name supplied in the DHCP request will be used # to look up the desired STATIC ip in /etc/hosts dhcp-host=pokey dhcp-host=SmithPC dhcp-host=TCdesk # # This one is a LINUX server, that does not seem to have # a "name" in its DHCP requests. Just resolve this one # by MAC address dhcp-host=00:E0:81:3A:74:DB,odin,10.1.10.186 # # This one is a printer with built in print server. # I don't think it provides a proper "name" for # dhcp either, so use mac here too... dhcp-host=08:00:37:2C:E5:52,dell5100cn # # # Inform clients to go back to the comcast router # if this DNS server fails... dhcp-option=3,10.1.10.1 # dhcp-authoritative
The /etc/hosts file has entries like:
10.1.10.40 pokey 10.1.10.41 SmithPC 10.1.10.42 TCdesk 10.1.10.186 odin 10.1.10.59 dell5100cn printer1

