Running a basic BIND DNS Server
Install BIND in a chroot environment.
yum install bind bind-chroot bind-libs bind-utils caching-nameserver -y
====
====[root@hostname etc]# cat named.conf
options
{
directory “/etc”; // we are in a chroot environment
};//zone listings
zone “localhost” {
type master;
file “/etc/zones/pri/localhost.zone”;
};zone “movement3.info” {
type master;
file “/etc/zones/pri/movement3.info”;
};====
====
[root@hostname etc]# cat zones/pri/movement3.info
$TTL 1H@ IN SOA dns1.movement3.info. root (
2012052201 ; serial – YYYYMMDDxx
1H ; refresh
30M ; retry
4W ; expire
1H ) ; negative TTL
NS dns1.movement3.info.
NS dns2.movement3.info.A 1.1.1.1
dns1 A 2.2.2.2
dns2 A 3.3.3.3
www A 4.4.4.4
test 600 A 4.2.2.2
test1 600 A 1.1.1.1
service named restart|start|stop
chkconfig –level 2345 named on
vim /etc/sysconfig/iptables
(need to allow both tcp and udp for DNS to work)
service iptables restart
The slave DNS server will check with the master DNS every 1 hour (refresh value). If the slave DNS can’t reach
the master, it will try every 30 mins (retry value) for 4 weeks (expire value). After 4 weeks, it will expire
the zone data and stop answering requests for the zone.
Negative TTL, how long DNS server will remember negative lookups — when there is no DNS entry.
http://linuxgravity.com/configuring-bind9-domain-name-server-on-centos-or-red-hat
http://www.howtoforge.com/creating-your-own-webserver-with-bind-and-apache-centos5
http://www.sorbs.net/faq/dns_primer.shtml