DNS named installation
Step 1
[root@~]# yum install caching-nameserver
Install named program via yum
Step 2
[root@~]# vi /var/named/chroot/etc/named.conf
options {
directory "/var/named";
pid-file "/var/run/named/named.pid";
// query-source address * port 53;
};
logging {
category "default" { "debug"; };
category "general" { "debug"; };
category "database" { "debug"; };
category "security" { "debug"; };
category "config" { "debug"; };
category "resolver" { "debug"; };
category "xfer-in" { "debug"; };
category "xfer-out" { "debug"; };
category "notify" { "debug"; };
category "client" { "debug"; };
category "unmatched" { "debug"; };
category "network" { "debug"; };
category "update" { "debug"; };
category "queries" { "debug"; };
category "dispatch" { "debug"; };
category "dnssec" { "debug"; };
category "lame-servers" { "debug"; };
channel debug {
file "/var/log/named.log";
print-time yes;
print-category yes;
};
};
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
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; };
};
include "/etc/rndc.key";
cd /etc
ln -s /var/named/chroot/etc/named.conf
mv /var/named/chroot/etc/named.caching-nameserver.conf /tmp
rm /etc/named.caching-nameserver.conf
Create the basic config of named '/etc/named.conf' and remove the default conf
Step 3
[root@~]# cd /var/log
ln -s /var/named/chroot/var/log/named.log
Create the symbolic to log which we defined.
chmod 777 -Rvf /var/named/
[root@~]# chkconfig named on
[root@~]# /etc/init.d/named start
Start named service and set auto-start feature.
[root@~]# vi /etc/resolv.conf
nameserver 127.0.0.1
nameserver 202.177.26.100
Edit recolv.conf and insert the first primary dns '127.0.0.1' for your server.
Step 4
[root@~]# dig @127.0.0.1 yahoo.com
[root@~]# less /var/log/named.log
Testing query yahoo.com and view back the log in your basic named DNS server.
DNS server is used port 53, remember add accept rule in Linux server's iptables and NAT port forwart of port 53 (If it used as public DNS server).
Server is hosted by Alanstudio
Linux Operating System
Recommend screen resolution 1024 x 768 / IE / FireFox
Alan Studio © 2007 by Alan Cheung Hin Lun. All rights reserved.
|