{"id":7052,"date":"2017-10-11T18:05:53","date_gmt":"2017-10-11T10:05:53","guid":{"rendered":"http:\/\/rmohan.com\/?p=7052"},"modified":"2017-10-11T18:05:53","modified_gmt":"2017-10-11T10:05:53","slug":"how-to-configure-primary-dns-server-in-redhat-6-step-by-step","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7052","title":{"rendered":"How to Configure Primary DNS Server in redhat 6 Step by Step"},"content":{"rendered":"<p>How to Configure Primary DNS Server in redhat 6 Step by Step<br \/>\nDomain Name Server (DNS) Configuration and Administration<\/p>\n<p>Domain Name System<br \/>\nThe Domain Name System (DNS) is the crucial glue that keeps computer networks in harmony by converting human-friendly hostnames to the numerical IP addresses computers require to communicate with each other. DNS is one of the largest and most important distributed databases the world depends on by serving billions of DNS requests daily for public IP addresses. Most public DNS servers today are run by larger ISPs and commercial companies but private DNS servers can also be useful for private home networks. This article will explo<\/p>\n<p>To Check IP<br \/>\n[root@www Desktop]# ifconfig<br \/>\neth0      Link encap:Ethernet  HWaddr 00:0C:29:84:6D:8C<br \/>\n          inet addr:10.90.12.1  Bcast:10.90.12.255  Mask:255.255.255.0<br \/>\n          inet6 addr: fe80::20c:29ff:fe84:6d8c\/64 Scope:Link<br \/>\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br \/>\n          RX packets:6624 errors:0 dropped:0 overruns:0 frame:0<br \/>\n          TX packets:1474 errors:0 dropped:0 overruns:0 carrier:0<br \/>\n          collisions:0 txqueuelen:1000<br \/>\n          RX bytes:442710 (432.3 KiB)  TX bytes:1901220 (1.8 MiB)<br \/>\n          Interrupt:19 Base address:0x2000<\/p>\n<p>eth1      Link encap:Ethernet  HWaddr 00:0C:29:84:6D:96<br \/>\n          inet addr:10.23.151.66  Bcast:10.23.159.255  Mask:255.255.224.0<br \/>\n          inet6 addr: fe80::20c:29ff:fe84:6d96\/64 Scope:Link<br \/>\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br \/>\n          RX packets:13927 errors:0 dropped:0 overruns:0 frame:0<br \/>\n          TX packets:7518 errors:0 dropped:0 overruns:0 carrier:0<br \/>\n          collisions:0 txqueuelen:1000<br \/>\n          RX bytes:9215651 (8.7 MiB)  TX bytes:948169 (925.9 KiB)<br \/>\n          Interrupt:19 Base address:0x2080<\/p>\n<p>lo        Link encap:Local Loopback<br \/>\n          inet addr:127.0.0.1  Mask:255.0.0.0<br \/>\n          inet6 addr: ::1\/128 Scope:Host<br \/>\n          UP LOOPBACK RUNNING  MTU:16436  Metric:1<br \/>\n          RX packets:8 errors:0 dropped:0 overruns:0 frame:0<br \/>\n          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0<br \/>\n          collisions:0 txqueuelen:0<br \/>\n          RX bytes:480 (480.0 b)  TX bytes:480 (480.0 b)<\/p>\n<p>To Set DNS Server IP<br \/>\nvi \/etc\/sysconfig\/network-scripts\/ifcfg-eth0<\/p>\n<p>EVICE=eth0<br \/>\nHWADDR=00:0c:29:84:6d:8c<br \/>\nNM_CONTROLLED=no<br \/>\nONBOOT=yes<br \/>\nIPADDR=10.90.12.1<br \/>\nBOOTPROTO=none<br \/>\nNETMASK=255.255.255.0<br \/>\nDNS=10.90.12.1<br \/>\nTYPE=Ethernet<br \/>\nIPV6INIT=no<br \/>\nUSERCTL=no<\/p>\n<p>save :wq<\/p>\n<p>To Set Host Name<br \/>\n[root@station Desktop]# vim \/etc\/sysconfig\/network<\/p>\n<p>NETWORKING=yes<br \/>\nHOSTNAME=station.example.com<\/p>\n<p>save :wq<\/p>\n<p>[root@station Desktop]# vim \/etc\/hosts<br \/>\n0.90.12.1      station.example.com     station<\/p>\n<p>save :wq<\/p>\n<p>[root@station Desktop]# vim \/etc\/resolv.conf<br \/>\nsearch station.example.com<br \/>\nnameserver 10.90.12.1<\/p>\n<p>save :wq<\/p>\n<p>[root@station Desktop]# hostname station.example.com<\/p>\n<p>[root@station Desktop]# hostname<br \/>\nstation.example.com<\/p>\n<p>To Install Package<br \/>\n[root@station Desktop]# yum install bind*<br \/>\nLoaded plugins: fastestmirror, refresh-packagekit, security<br \/>\nRepository &#8216;yum&#8217; is missing name in configuration, using id<br \/>\nLoading mirror speeds from cached hostfile<br \/>\nSetting up Install Process<br \/>\nPackage 32:bind-utils-9.7.3-8.P3.el6.i686 already installed and latest version<br \/>\nPackage 32:bind-libs-9.7.3-8.P3.el6.i686 already installed and latest version<br \/>\nResolving Dependencies<br \/>\n&#8211;> Running transaction check<br \/>\n&#8212;> Package bind.i686 32:9.7.3-8.P3.el6 will be installed<br \/>\n&#8212;> Package bind-chroot.i686 32:9.7.3-8.P3.el6 will be installed<br \/>\n&#8212;> Package bind-dyndb-ldap.i686 0:0.2.0-7.el6 will be installed<br \/>\n&#8211;> Finished Dependency Resolution<\/p>\n<p>Dependencies Resolved<\/p>\n<p>================================================================================<br \/>\n Package                Arch        Version                    Repository  Size<br \/>\n================================================================================<br \/>\nInstalling:<br \/>\n bind                   i686        32:9.7.3-8.P3.el6          yum        3.9 M<br \/>\n bind-chroot            i686        32:9.7.3-8.P3.el6          yum         67 k<br \/>\n bind-dyndb-ldap        i686        0.2.0-7.el6                yum         49 k<\/p>\n<p>Transaction Summary<br \/>\n================================================================================<br \/>\nInstall       3 Package(s)<\/p>\n<p>Total download size: 4.0 M<br \/>\nInstalled size: 7.1 M<br \/>\nIs this ok [y\/N]: y<br \/>\nDownloading Packages:<br \/>\n(1\/3): bind-9.7.3-8.P3.el6.i686.rpm                      | 3.9 MB     00:00<br \/>\n(2\/3): bind-chroot-9.7.3-8.P3.el6.i686.rpm               |  67 kB     00:00<br \/>\n(3\/3): bind-dyndb-ldap-0.2.0-7.el6.i686.rpm              |  49 kB     00:00<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nTotal                                            20 MB\/s | 4.0 MB     00:00<br \/>\nRunning rpm_check_debug<br \/>\nRunning Transaction Test<br \/>\nTransaction Test Succeeded<br \/>\nRunning Transaction<br \/>\nWarning: RPMDB altered outside of yum.<br \/>\n  Installing : 32:bind-9.7.3-8.P3.el6.i686                                  1\/3<br \/>\n  Installing : 32:bind-chroot-9.7.3-8.P3.el6.i686                           2\/3<br \/>\n  Installing : bind-dyndb-ldap-0.2.0-7.el6.i686                             3\/3<\/p>\n<p>Installed:<br \/>\n  bind.i686 32:9.7.3-8.P3.el6            bind-chroot.i686 32:9.7.3-8.P3.el6<br \/>\n  bind-dyndb-ldap.i686 0:0.2.0-7.el6  <\/p>\n<p>Complete!<br \/>\n[root@station Desktop]#<\/p>\n<p> To Copy named.conf file<br \/>\n[root@station Desktop]# cp \/etc\/named.conf  \/var\/named\/chroot\/etc\/named.conf<\/p>\n<p>To Change directory<br \/>\n cd \/var\/named\/chroot\/etc\/<\/p>\n<p>To edit configuration file<br \/>\n[root@station etc]#vim named.conf<br \/>\noptions {<br \/>\n        directory       &#8220;\/var\/named&#8221;;<br \/>\n};<\/p>\n<p>zone &#8220;example.com&#8221; IN {<br \/>\n        type master;<br \/>\n        file &#8220;for.zone&#8221;;<br \/>\n};<\/p>\n<p>zone &#8220;12.90.10.in-addr.arpa&#8221; IN {<br \/>\n        type master;<br \/>\n        file &#8220;rev.zone&#8221;;<br \/>\n};<\/p>\n<p>save :wq<\/p>\n<p>To Change Group Name<br \/>\n[root@station etc]# chgrp named named.conf<\/p>\n<p>To Copy File same Location<br \/>\n[root@station etc]# cp \/var\/named\/named.localhost \/var\/named\/chroot\/var\/named\/for.zone<br \/>\n[root@station etc]# cp \/var\/named\/named.loopback \/var\/named\/chroot\/var\/named\/rev.zone<\/p>\n<p>To change directory<br \/>\n[root@station etc]# cd \/var\/named\/chroot\/var\/named\/<\/p>\n<p>To edit configuration file<br \/>\n[root@station named]# vim for.zone<br \/>\n$TTL 1D<br \/>\n@       IN SOA  example.com. root.example.com. (<br \/>\n                                        0       ; serial<br \/>\n                                        1D      ; refresh<br \/>\n                                        1H      ; retry<br \/>\n                                        1W      ; expire<br \/>\n                                        3H )    ; minimum<br \/>\n@       IN      NS      station.example.com.<br \/>\nstation IN      A       10.90.12.1<\/p>\n<p>save :wq<\/p>\n<p>To edit configuration file<br \/>\n[root@station named]# vim rev.zone<br \/>\n$TTL 1D<br \/>\n@       IN SOA  example.com. root.example.com. (<br \/>\n                                        0       ; serial<br \/>\n                                        1D      ; refresh<br \/>\n                                        1H      ; retry<br \/>\n                                        1W      ; expire<br \/>\n                                        3H )    ; minimum<br \/>\n@       IN      NS      station.example.com.<br \/>\n1       IN      PTR     station.example.com.<\/p>\n<p>save :wq<\/p>\n<p>To Change Group Name<br \/>\n[root@station named]# chgrp named for.zone<br \/>\n[root@station named]# chgrp named rev.zone<br \/>\n[root@station named]# ll<br \/>\ntotal 8<br \/>\n-rw-r&#8212;&#8211;. 1 root named 190 Jun  1 19:12 for.zone<br \/>\n-rw-r&#8212;&#8211;. 1 root named 196 Jun  1 19:15 rev.zone<br \/>\n[root@station named]#<\/p>\n<p>To Restart Service &#038; On<br \/>\n[root@station named]# service named restart<br \/>\nStopping named:                                            [  rajesh  ]<br \/>\nStarting named:                                            [  rajesh  ]<\/p>\n<p>[root@station named]# chkconfig named on<\/p>\n<p>To Check Named Server<br \/>\n[root@station named]# dig 10.90.12.1<\/p>\n<p>; <<>> DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6 <<>> 10.90.12.1<br \/>\n;; global options: +cmd<br \/>\n;; Got answer:<br \/>\n;; ->>HEADER<<- 23819=\"\" br=\"\" id:=\"\" nxdomain=\"\" opcode:=\"\" query=\"\" status:=\"\">;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0<\/p>\n<p>;; QUESTION SECTION:<br \/>\n;10.90.12.1.            IN    A<\/p>\n<p>;; AUTHORITY SECTION:<br \/>\n.            10800    IN    SOA    a.root-servers.net. nstld.verisign-grs.com. 2012060501 1800 900 604800 86400<\/p>\n<p>;; Query time: 193 msec<br \/>\n;; SERVER: 113.193.1.14#53(113.193.1.14)<br \/>\n;; WHEN: Fri Jun  1 19:17:27 2012<br \/>\n;; MSG SIZE  rcvd: 103<\/p>\n<p>[root@station named]# dig station.example.com<\/p>\n<p>; <<>> DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6 <<>> station.example.com<br \/>\n;; global options: +cmd<br \/>\n;; Got answer:<br \/>\n;; ->>HEADER<<- 24133=\"\" br=\"\" id:=\"\" noerror=\"\" opcode:=\"\" query=\"\" status:=\"\">;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0<\/p>\n<p>;; QUESTION SECTION:<br \/>\n;station.example.com.        IN    A<\/p>\n<p>;; ANSWER SECTION:<br \/>\nstation.example.com.    86400    IN    A    10.90.12.1<\/p>\n<p>;; AUTHORITY SECTION:<br \/>\nexample.com.        86400    IN    NS    station.example.com.<\/p>\n<p>;; Query time: 1 msec<br \/>\n;; SERVER: 10.90.12.1#53(10.90.12.1)<br \/>\n;; WHEN: Fri Jun  1 19:17:47 2012<br \/>\n;; MSG SIZE  rcvd: 67<\/p>\n<p>[root@station named]#<\/p>\n<p>Client end Setting <\/p>\n<p>[admin@station1]$vim \/etc\/resolve.conf<\/p>\n<p>search station.example.com<br \/>\nnameserver 10.90.12.1<br \/>\nSave :wq<br \/>\n[admin@station1]$ dig station.example.com<\/p>\n<p>; <<>> DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6 <<>> station.example.com<br \/>\n;; global options: +cmd<br \/>\n;; Got answer:<br \/>\n;; ->>HEADER<<- 24133=\"\" br=\"\" id:=\"\" noerror=\"\" opcode:=\"\" query=\"\" status:=\"\">;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0<\/p>\n<p>;; QUESTION SECTION:<br \/>\n;station.example.com.        IN    A<\/p>\n<p>;; ANSWER SECTION:<br \/>\nstation.example.com.    86400    IN    A    10.90.12.1<\/p>\n<p>;; AUTHORITY SECTION:<br \/>\nexample.com.        86400    IN    NS    station.example.com.<\/p>\n<p>;; Query time: 1 msec<br \/>\n;; SERVER: 10.90.12.1#53(10.90.12.1)<br \/>\n;; WHEN: Fri Jun  1 19:17:47 2012<br \/>\n;; MSG SIZE  rcvd: 67<br \/>\nEnjoy&#8230;&#8230;&#8230;.!!!!!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Configure Primary DNS Server in redhat 6 Step by Step Domain Name Server (DNS) Configuration and Administration<\/p>\n<p>Domain Name System The Domain Name System (DNS) is the crucial glue that keeps computer networks in harmony by converting human-friendly hostnames to the numerical IP addresses computers require to communicate with each other. DNS is [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7052"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7052"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7052\/revisions"}],"predecessor-version":[{"id":7053,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7052\/revisions\/7053"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}