Tuesday, March 3, 2009

Step-by-Step configurationo f DNS in RHEL 5.0

check your resolve.conf file 
check your hosts file 
after changing this file to restart your network service 

1. install bind all package
2. install caching-nameserver
3. cd /var/named/chroot/etc
4. cp named.caching-nameserver.conf named.conf
5. vim named.conf
after open named.conf file change listen port
allow quary
forwarders 
forward only
6. append named.rfc1912.zones to named.conf

command is 

7. cat named.rfc1912.zones >> named.conf
8. after this file append open named.conf file
9. creat forward zone and reverce zone

//Forward Lookup Zone
zone "example.com" {
      type master;
      file "example.com.zone";
};


##############################################################
//Reverse Lookup Zone
zone "0.168.192.in-addr.arpa" {
      type master;
      file "192.168.0.zone";
};

10. after this step plaese see your iptables 
 
if iptables is show rules so flus this iptables or add rules allow 53 port

10. now create master dns file , forward and reverce
11. cd /var/named/chroot/var/named/
12. copy localdomain.zone file to example.com.zone file  command is
13. cp localdomain.zone example.com.zone
14. after copy this file edit this file as bellow 

$TTL    86400
example.com.            IN SOA  station19.example.com. root.station19.example.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
                IN NS           station19.example.com.
station9.example.com.  IN A            192.168.0.9


15. after this file edit user for command 
16. for i in {1..254}; do echo "station$i.example.com.   IN  A  192.168.0.$i"; done and see this command is ok  now this command append to example.com.zone file , command is 

17. for i in {1..254}; do echo "station$i.example.com.   IN  A  192.168.0.$i"; done >> example.com.zone

18. copy named.ca to 192.168.0.zone file the command is 

19. cp named.ca 192.168.0.zone after this command open 192.168.0.zone file and edit as bellow

20.

$TTL    86400
0.168.192.IN-ADDR.ARPA.       IN      SOA     station19.example.com. root.station19.example.com.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN      NS      station19.example.com.
1       IN      PTR     station19.example.com.


after this edit use for command the command is 


21. for i in {1..254}; do echo "$i IN PTR station$i.example.com."; done 
22. afer this command is work is ok then appen this command to 192.168.0.zone file 
23. for i in {1..254}; do echo "$i IN PTR station$i.example.com."; done >> 192.168.0.zone
24. now your named service restart 
25. dig station19.example.com to see forward zone 
26. dig -x 192.168.0.19 to see reverce zone 

if dig command is work then your DNS configration is Ok


Thanks,
Rambilas Varma

1 comment:

  1. its to dificult for new user. please explane it clearly.

    ReplyDelete