JAVA SCRIPT

RH 253: HOW TO SET UP PRIMARY DNS SERVER

    TO SET UP PRIMARY DNS SERVER


 Set up static ip and host name for your machine



SERVER - Steps on server

1. yum install bind caching-nameserver -y
2. vim /etc/named.conf                            ->edit this file
3. named-checkconf   /etc/named.conf
4. cd /var/named
5. cp localhost.zone  forward.zone
6. vim forward.zone                               ->edit this file
7. named-checkzone  <domainname>   forward.zone
8. cp forward.zone reverse.zone
9. vim reverse.zone                               ->edit this file
10. named-checkzone  <domainname>   reverse.zone 
11.vim /etc/sysconfig/network-scripts/ifcfg-eth0 ->edit this file
      PEERDNS=no
12.service network restart
13.vim /etc/resolv.conf                          ->edit this file
14.service named restart
15.chkconfig named on


CLIENT - Steps on client

1. vim /etc/resolv.conf    ->edit the file
2.  dig       <hostname>
3.  host      <hostname>
4.  host      <IP>
5.  nslookup  <IP>
6.  nslookup  <hostname>




CONFIGURATION FILES


1.  forward.zone


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

            IN NS        server.matrix.com.
server         IN A        192.168.0.59
client1         IN A        192.168.0.58
client2         IN A        192.168.0.57



2.  named.conf


options {
directory "/var/named";
};


zone "matrix.com"{
type master;
file "forward.zone";
};

zone "0.168.192.in-addr.arpa"{
type master;
file "reverse.zone";
};



3. resolv.conf


search matrix.com
nameserver 192.168.0.59



4.  reverse.zone


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

            IN NS        server.matrix.com.
            IN A        192.168.0.59
59            IN PTR        server.matrix.com.
58            IN PTR        client1.matrix.com.
57            IN PTR        client2.matrix.com.




If you found this post useful, I would really love it, if you can Like the Page, or share it with your Facebook/Google+/Twitter Friends... It will keep me motivated. Thank you!

No comments:

Post a Comment