A local DNS allows me to give proper names to machines on my network. Its the bit that converts www.bbc.co.uk into 212.58.224.56 The numbers are the IP address and the ‘proper’ way that computers find each other, and DNS stands for Domain Name System.
Why?
Always a good question, and one I ask often. Three reasons, firstly some DNS knowledge is required for the impending linux professional exam. Secondly it allows the machines on my local computing setup to find each other without each individual one having a ‘hosts’ file, the DNS acts as a central point which all machines ask when trying to resolve an address ie: convert ergo into 192.168.0.15 And thirdly you need DNS setup to configure sendmail, another requirement of the exam. And it will also cache ie: remember address’ it has resolved in the past, theoreticaly speeding up DNS since my own network wont have to go out through the internet and ask my ISP to do it.
What’s in a named
Confusingly DNS is implemented via a package named ‘bind’ which runs the ‘named’ daemon. Configuration is done in named.conf and various other zone files that define the machines you want to ‘know’ about. So my DNS server knows about my local network in the ‘.home’ zone and is thus the ‘authority’ for anything in .home (just as somewhere a machine is the authority for the .co.uk zone) Setup is suprisingly easy - just take it steady. Good instructions are at Tech Recipes. So for these examples my DNS server is on ‘ergo’ and the domain is ‘home’. Testing you’ve got it right can be done by: ` dig ergo.home ` on your DNS server (ie my ergo machine) which should report back the IP address of ergo and that it is an authoritive record. ` dig mx home ` will tell you where email for the .home zone should be processed ie: where my sendmail server is listening and processing. For other machines inside .home, set them to use your own DNS server, not the one setup by your ISP. Under Windows its a ‘network neighbourhood/properties/TCPIP’ thing. Under Linux edit /etc/resolv.conf. Resolution of names outside of your own .home zone is passed on to the ISP nameservers, this is configured as the ‘forwarders’ entry in named.conf, in other words anything my DNS has’nt been told about, go ask the ISP.
CNAME to alias names
Normally a machine has a single simple entry: ` viglen IN A 192.168.0.12 ` to determine its IP address, but it can also be given an alias (in this example ‘www’): ` www IN CNAME viglen ` This allows a neat trick to change a web address like: ` http://viglen/mysite/index.xml ` into: ` http://www.home/mysite/index.xml ` As you can see part of the power of DNS is to remove specific names and replace them with nice generic onesof your choice. If I moved a website off viglen to another of my machines, I could still refer to www.home to reach it - all I have to do is make one change in the DNS CNAME record. Pointless on a small network perhaps, but vital in corporate setups.