Home > CentOS > Install DNS

Install
yum install bind caching-nameserver

Create config file
touch /var/named/chroot/etc/named.conf
ln -s /var/named/chroot/etc/named.conf /etc/named.conf
chown -R named /var/named/chroot
vim /etc/named.conf

options {
listen-on port 53 { any; };
listen-on-v6 port 53 { any; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
};

zone "my-helper.com" {
type master;
file "my-helper.com";
};

Create zone file
vim /var/named/chroot/var/named/my-helper.com

$TTL 86400
@ IN SOA ns1.my-helper.com info.my-helper.com (
2011061800 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS ns1.my-helper.com.
IN NS ns2.my-helper.com.
ns1 IN A 127.0.0.1
ns2 IN A 127.0.0.1
www IN A 127.0.0.1

Restart server
service named restart

Automatic turn on servers on reboot
chkconfig named on

Edit hostname resolver config file
vim /etc/resolv.conf

nameserver 10.0.0.1

reference:
http://blog.weithenn.org/2009/04/centosbind9-domain-nameip.html
http://fastcreators.com/article/2007/01/24/howto-caching-nameserver-and-bind-9-togather/



Flag Counter