Wednesday, March 19, 2008

Linux DNS setup

Steps to follow to configure DNS:
1. Install bind packages and caching packages.
#rpm -ivh bind*
#rpm -ivh caching*
2. open /etc directory.you will find two files:
named.caching-nameserver.conf,
named.rfc1912.zone#cd /etc# ls -l named.*
3. open the first file in VI editor
# vi named.caching-nameserver.conf
at line 15 add the IP addres of your DNS server
at line 23 allow-query
{local host; 192.168.0.0/24;}
at line 32 match-client
{local host;192.168.0.0/24;}
Note : i am using 192.168.0.0 as an example network.
save the file
4. open the second file in VI editor
# vi named.rfc1912.zone
copy the lines from line 21 to line 25 and paste at the end. Edit the lines as follows :
zone "xxx.com" {
type master;
xxx.for";
allow-update {none};
}
save the file
5. Now go to /var/named/chroot/var/named
6. copy the file localhost.zone and name it as xxx.for# cp localhost.zone xxx.for
7. Open the file xxx.forand add following lines in the end.
sys1 IN A 192.168.0.1
sys2 IN A 192.168.0.2
save the file
8. #vi /etc/resolv.conf
nameserver 192.168.0.3
Note : ip address of the machine you are configuring as DNS server.
9. now start the service
#service named restart
#nslookup
enter the name and u should get the ip address as reply

No comments: