Local DNS Setup Question

William Carty yellowdog-general@lists.terrasoftsolutions.com
Tue Dec 10 17:03:01 2002


James Applebaum wrote:
> I am attempting to setup a local DNS to resolve a local Intranet 
> service. Would like to do this on the same server as the intranet web 
> services are running from. The Server has no access to the outside would 
> so I am confused by the documentation... I expect this is much simpler 
> then the documentation is making it for my purposes.
> 
> The URL would be home.<servername>.com
> 
> If anyone has a good "I.E." basic config setup I would be very grateful.
> 
> 

You don't say what version of bind you're trying to use.  I'll assume 9. 
    Also assume that your local address space is 192.168.0.0 :

+++++++++++++++++++++++++++++++++++++
/etc/named.conf:
+++++++++++++++++++++++++++++++++++++

options {
         directory "/var/named";
};

controls {
         inet 127.0.0.1 allow { localhost; };
};
zone "." IN {
         type hint;
         file "named.ca";
};

zone "localhost" IN {
         type master;
         file "localhost.zone";
         allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
         type master;
         file "named.local";
         allow-update { none; };
};

zone "home.servername.com" IN {
         type master;
         file "home.servername.com.hosts";
};

zone "0.168.192.in-addr.arpa" IN {
         type master;
         file "0.168.192.hosts";
};

+++++++++++++++++++++++++++++++++++++
/var/named/home.servername.com.hosts:
+++++++++++++++++++++++++++++++++++++

$TTL 604800
@       IN      SOA     foo.home.servername.com. 
root.foo.home.servername.com.   (
                         2002121002      ;
                         8H              ;
                         2H              ;
                         4W              ;
                         1D )            ;
                 NS      foo.home.servername.com.
		MX	foo.home.servername.com.	;

foo		A	192.168.0.1
host1		A	192.168.0.2
host2		A	192.168.0.3
<etc, etc>


+++++++++++++++++++++++++++++++++++++
/var/named/0.168.192.hosts
+++++++++++++++++++++++++++++++++++++

$TTL 604800
@       IN      SOA     foo.home.servername.com. 
root.foo.home.servername.com.   (
                         2002121002      ;
                         8H              ;
                         2H              ;
                         4W              ;
                         1D )            ;
                 NS      foo.home.servername.com.	;

1       IN PTR  foo.home.servername.com.
2       IN PTR  host1.home.servername.com.
3	IN PTR	host2.home.servername.com.
<etc, etc>

Where 1,2 & 3 = 192.168.0.1, 192.168.0.2 & 192.168.0.3.

Other relevant files should have been installed by bind...  Watch word 
wrap...  Works for me, but double check the docs - this is a quick & 
dirty write-up, may have made a typo somewhere.  Tweak as per your needs.

Good luck.