Recent Changes - Search:

Softwares

.

ConfiguringTheDNSServer

Setting Up a DNS Server if you are using redhat servers

STEP 1...First we need to get the following bind packages..

  # rpm -qa|grep bind 
  bind-devel-9.2.1-16 
  bind-utils-9.2.1-16 
  bind-9.2.1-16 
  redhat-config-bind-1.9.0-13 

STEP 2...

After the above packages are installed we need to open/edit the file /etc/named.conf and then create a entry for our primary and secondary name servers,which are ns0.armia8dns.com and ns1.armia8dns.com and ns0.armia8dns.com has an ip 192.168.0.8 and ns2.armia8dns.com has the ip address 192.168.0.9

ADDING THE NAME SERVERS ns0.armiadns.com and ns1.armiadns.com...

  [~]# vi /etc/named.conf 


      zone "ns0.armia8dns.com" { 
        type master; 
        file "/var/named/ns0.armia8dns.com.db"; 
    }; 

The 3rd step is to create the db file for the above dns in /var/named/

  [~]# vi /var/named/ns0.armia8dns.com.db 



    $ORIGIN . 
    $TTL    86400 
    ns0.armia8dns.com     IN SOA  ns0.armia8dns.com.       root.armia8.com. ( 
                                        42              ; serial (d. adams) 
                                        3H              ; refresh 
                                        15M             ; retry 
                                        1W              ; expiry 
                                        1D )            ; minimum 

                         IN   NS           ns0.armia8dns.com. 
                         IN   NS           ns1.armia8dns.com. 
                         IN   A            192.168.0.8 
                         IN   MX         0 ns0.armia8.com. 
    $ORIGIN ns0.armia8dns.com. 
    localhost                     A            127.0.0.1 

STEP 3 A

Now again for ns1.armia8dns.com add the entry in /etc/named.conf as shown below

        zone "ns1.armia8dns.com" { 
        type master; 
        file "/var/named/ns1.armia8dns.com.db"; 
       };

STEP 3 B

   Again create a file named /var/named/ns1.armia8dns.com.db 

   [~]# vi /var/named/ns1.armia8dns.com.db 



   $ORIGIN . 
   $TTL    86400 
   ns1.armia8dns.com   IN SOA  ns0.armia8dns.com.       root.armia8.com. ( 
                                        42              ; serial (d. adams) 
                                        3H              ; refresh 
                                        15M             ; retry 
                                        1W              ; expiry 
                                        1D )            ; minimum 

                         IN   NS           ns0.armia8dns.com. 
                         IN   NS           ns1.armia8dns.com. 
                         IN   A            192.168.0.9 
                         IN   MX         0 ns1.armia8.com. 
  $ORIGIN ns1.armia8dns.com. 
  localhost                     A            127.0.0.1 

STEP 4...

Now we can start named on the server and see if armia8dns worksfine or not, we can use the dig command or the command such as ping to test this.

  #dig ns0.armia8dns.com   and dig ns1.armia8dns.com

ADDING A DOMAIN TO THE DNS FILE AND TO /var/named

STEP 5...

The 4th step is to add a new domain "itmission.org" to the dns.

STEP 6...

Open the file /etc/named.conf and add the following line to the file named.conf

  [~]# vi /etc/named.conf 




       zone "itmission.org" { 
        type master; 
        file "/var/named/itmission.org"; 
      };

STEP 7...

The 7th step is to create the db file for the above domain "ITMISSION.ORG" dns in /var/named/

  [~]# vi /var/named/itmission.org.db 



    $TTL    86400 
    @          IN SOA  ns0.armia8dns.com.       root.armia8.com. ( 
                                        42              ; serial (d. adams) 
                                        3H              ; refresh 
                                        15M             ; retry 
                                        1W              ; expiry 
                                        1D )            ; minimum 

    itmission.org.                  IN         NS           ns0.armia8dns.com. 
    itmission.org.                  IN         NS           ns1.armia8dns.com. 
    itmission.org.                  IN         A            192.168.0.8 
    localhost.itmission.org.        IN         A            127.0.0.1 
    itmission.org.                  IN         MX 0         itmission.org. 
    www                          IN         CNAME           itmission.org. 
    mail                         IN         CNAME           itmission.org. 

STEP 8...

Restart the dns server and then try to check the domain itmission.org

STARTING BIND SERVER

/etc/init.d/named restart

service named restart

rndc reload

STEP 9...

Now if you would like to add subdomain entries...do use the following entries in the file /etc/named/itmission.org.db

   admin                        IN      A  192.168.0.8 
   www.admin                    IN      A  192.168.0.8 
   ads                          IN      A  192.168.0.8 
   www.ads                      IN      A  192.168.0.8 

check to see if /etc/resolv.conf are setup correctly for DNS .

Resources..http://www.isc.org/index.pl?/sw/bind/FAQ.php

Edit - History - Print - Recent Changes - Search
Page last modified on January 14, 2008, at 12:30 PM