How to set up a DNS server for your home office
Monday, September 24th, 2007A home office DNS server basically is a full feature DNS server with two specials:
- It resolve the local domain name which is only used internally, pretty much like: main.home and bedroom.home.
- For the public domain name, it prefer to be just as a forwarder of your ISP’s DNS.
First, you will install the DNS server software. It is quite easy on Fedora:
yum install bind yum install bind-chroot /sbin/chkconfig named on /sbin/service named start
Then, create a DNS config file under /var/named/chroot/etc :
options {
directory "/var/named";
query-source address * port 53;
allow-query { localnets; };
forward first;
forwarders {
// put your ISP's DNS here.
// the forward DNS of your router won't work
64.70.22.12;
};
};
include "/etc/named.rfc1912.zones";
zone "home" {
type master;
file "home.zone";
};
zone "6.168.192.in-addr.arpa" {
type master;
file "6.168.192.in-addr.zone";
};
include "/etc/rndc.key";
Then, you will create your local .home domain zone file and its reverse resolve file under /var/named/chroot/var/named.
I give my example here, the main.home (192.168.6.20) is the DNS server of local network, the jeff.home (192.168.6.33) is the work station.
home.zone:
$TTL 3600 $ORIGIN home. home. IN SOA main root ( 20070924 ; Serial 10800 ; Refresh 3600 ; Retry 604800 ; Expire 86400 ) ; Minimum TTL @ IN NS main main IN A 192.168.6.20 jeff IN A 192.168.6.33 @ IN A 192.168.6.20
6.168.192.in-addr.zone:
$TTL 3600 6.168.192.in-addr.arpa. IN SOA main.home root ( 20070924 ; Serial 10800 ; Refresh 3600 ; Retry 604800 ; Expire 86400 ) ; Minimum TTL @ IN NS main.home. 20 IN PTR main.home. 33 IN PTR jeff.home.
