mattdorn.com

Generously funded by Matt Dorn

Added DNS to Home Network Setup

without comments

I’m running DNS locally on my home network now. The advantages of this are twofold: 1) local caching of domain names speeds up Web browsing on my network, and 2) I can now refer to the computers on my network by the names I’ve given the machines rather than by IP address.

Two packages are required to fulfill the necessary functions: “bind” and “caching-nameserver.”

While the concept of DNS seems simple–mapping IP address to human-readable names organized in a hierarchical structure–evidently it’s an extremely complicated subject. The O’Reilly volume DNS and BIND weighs in at 622 pages, more than the same publisher’s book TCP/IP Network Administration which covers DNS as well as most other Internet protocols.

Rather than tackle such a huge subject out of simple curiosity, I decided to just have a crack at editing the appropriate configuration files and starting the service. With the help of both documents mentioned above, I seem to have DNS up and running without any trouble.

Once again, I relied on the following two documents for help:

1, http://www.jandg-cooper.com/home_network/index.html
2. http://www.tldp.org/HOWTO/mini/Home-Network-mini-HOWTO.html

I started with document #1, since #2 only provided instructions on using DNS to cache domain names, rather than provide DNS service to your LAN. So from document #1, I modeled my “/etc/named.conf” is modeled on document #1. I left out the “key,” “controls,” and “acl” sections, changed the “forwarders” lines to my own ISP’s DNS servers, and added the following line underneath it:

allow-query { 192.168.1/24; 127.0.0.1/32; };

As for the rest of named.conf, I simply substituted my own network information where appropriate.

I changed “/var/named/named.local”, created “/var/named/named.dorn” and “/var/named/named.dorn-rev” and substituted “jandg-cooper.com” with “dorn.com” wherever appropriate. (Although I don’t own the domain “dorn.com,” I can use it internally since I’m currently not providing access to any Internet services outside my LAN.)

Finally, I changed /etc/sysconfig/network-scripts/ifcfg-eth0 in accordance with document #1:

RESOLV_MODS=no
PEERDNS=no
LOGDNS=yes

As for what I took from document #2, my “/etc/dhcpd.conf” file included the line “option ip-forwarding off,” which I think had to be removed in order to use DNS locally when appropriate. Also, I commented out the “domain-name-servers” option which referred to my ISPs domain name servers, and replaced it with the address for my own DNS server: “option domain-name-servers 192.168.1.1;”

Finally, following the advice of #2, I edited the line in “/etc/rc.d/init.d/named” which invokes the named daemon so that it would be run by “nobody” rather than root: “daemon named -u nobody -g nobody”. “chkconfig named on” inserted named to start automatically on boot in the appropriate runlevel, and after a reboot (or an “/etc/rc.d/init.d/named start”), DNS was up and running. I can now “telnet vox” instead of “telnet 192.168.1.1″, etc.

Written by mdorn

August 25th, 2003 at 11:54 pm

Posted in Uncategorized

Leave a Reply