Thursday, May 15, 2008

Fedora8:DNS-named

download the system-config-bind rpm package and install it.


http://www.bind9.net/manuals

/etc/named.conf

I have two networks:15.0.0.0/8 and 192.168.0.0/24. I define the corpnets, which queries will be allowed.
The Fedora computer with named service installed has the IP address 15.100.100.5. So I include the 15.100.100.5 in the listen-on port 53 { 127.0.0.1; 15.100.100.5; }. If I include the 192.168.35.0/24 network, I should add IP address to listen-port. Pay attention to allow-query. It includes the corpnets, which I defined.



vi /etc/named.conf
acl corpnets { 15.0.0.0/8; 192.168.0.0/24; };

options {
allow-query { localhost; corpnets;
};


listen-on port 53 { 127.0.0.1;15.100.100.5; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";

recursion yes;
};
=======
create a zone: test.com
=======
/etc/named.conf

I use the system-config-bind utility.

zone "test.com." IN {
type master;
file "test.com.db";
};

====
From /var/named/chroot/var/named directory, you will find the test.com.db file. This file includes all the records.

====
create some A records by system-config-bind

/var/named/chroot/var/named/test.com.db




edit /etc/resolv.conf file to use the newly-configured dns server.

search test.com.
nameserver 15.100.100.5

====
start named service:
service named start

test the dns server:
nslookup west
=====

Configuring DNS forwarder
I have a DNS server 15.168.35.228, which connects to Internet.
acl corpnets {
192.168.0.0/24;
15.0.0.0/8;
};


options {
forwarders { 15.168.35.228 port 53;};


allow-query {
localhost;
localnets;
corpnets;
};


listen-on port 53 { 127.0.0.1;15.100.100.5; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";

recursion yes;
};