{"id":2265,"date":"2012-03-14T20:18:15","date_gmt":"2012-03-14T12:18:15","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=2265"},"modified":"2023-04-28T09:49:40","modified_gmt":"2023-04-28T09:49:40","slug":"how-to-install-and-configure-bind-chroot-dns-server-on-rhel-6","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-and-configure-bind-chroot-dns-server-on-rhel-6\/","title":{"rendered":"How to Install and Configure Bind Chroot DNS Server on RHEL 6"},"content":{"rendered":"<p>In this post, i will guide you on how to install and configure Bind Chroot DNS server on Redhat Enterprise Linux 6 (RHEL 6). DNS is the Domain Name System that maintains a database that can help user\u2019s computer to translate domain names to IP addresses. This post will show the installation and configuration for bind-chroot 9.7 version. Assumed that you have configured your RHEL 6 with local yum repository as per documented in the following post.<br \/>\n<a href=\"https:\/\/webhostinggeeks.com\/howto\/how-to-setup-local-yum-repository-from-cd-romdvd-rom-image-on-rhel-6\/\">How to Setup Local Yum Repository from CD-ROM\/DVD-ROM image on RHEL 6<\/a><\/p>\n<p>1. Install Bind Chroot DNS Server<\/p>\n<pre>\n[root@rhel6 ~]# yum install bind-chroot -y\nLoaded plugins: rhnplugin\nThis system is not registered with RHN.\nRHN support will be disabled.\nSetting up Install Process\nResolving Dependencies\n--> Running transaction check\n---> Package bind-chroot.i686 32:9.7.0-5.P2.el6 set to be updated\n--> Processing Dependency: bind = 32:9.7.0-5.P2.el6 for package: 32:bind-chroot-9.7.0-5.P2.el6.i686\n--> Running transaction check\n---> Package bind.i686 32:9.7.0-5.P2.el6 set to be updated\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n====================================================================================================\n Package              Arch          Version                     Repository                     Size\n====================================================================================================\nInstalling:\n bind-chroot          i686          32:9.7.0-5.P2.el6           DVD-RHEL6-Repository           65 k\nInstalling for dependencies:\n bind                 i686          32:9.7.0-5.P2.el6           DVD-RHEL6-Repository          3.5 M\n\nTransaction Summary\n====================================================================================================\nInstall       2 Package(s)\nUpgrade       0 Package(s)\n\nTotal download size: 3.5 M\nInstalled size: 6.4 M\nDownloading Packages:\n----------------------------------------------------------------------------------------------------\nTotal                                                                30 MB\/s | 3.5 MB     00:00\nRunning rpm_check_debug\nRunning Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n  Installing     : 32:bind-9.7.0-5.P2.el6.i686                                                  1\/2\n  Installing     : 32:bind-chroot-9.7.0-5.P2.el6.i686                                           2\/2\n\nInstalled:\n  bind-chroot.i686 32:9.7.0-5.P2.el6\n\nDependency Installed:\n  bind.i686 32:9.7.0-5.P2.el6\n\nComplete!\n<\/pre>\n<p>2. Create a file \/var\/named\/chroot\/var\/named\/bloggerbaru.local with the following configuration :<\/p>\n<pre>\n[root@rhel6 ~]# vi \/var\/named\/chroot\/var\/named\/bloggerbaru.local\n<\/pre>\n<pre>\n;\n;       Addresses and other host information.\n;\n@       IN      SOA     bloggerbaru.local. hostmaster.bloggerbaru.local. (\n                               2011030801      ; Serial\n                               43200      ; Refresh\n                               3600       ; Retry\n                               3600000    ; Expire\n                               2592000 )  ; Minimum\n\n;       Define the nameservers and the mail servers\n\n               IN      NS      ns.bloggerbaru.local.\n               IN      A       192.168.1.43\n               IN      MX      10 mail.bloggerbaru.local.\n\nmail            IN      A       192.168.1.43\nns              IN      A       192.168.1.43\n<\/pre>\n<p>3. Generate an RNDC key :<br \/>\nThe rndc tool is used to managed the named daemon. We need to generate a keyfile called \/etc\/rndc.key which is referenced both by \/etc\/rndc.conf and \/etc\/named.conf. Execute the following command to generate the RNDC key :<\/p>\n<pre>\n[root@rhel6 ~]# rndc-confgen -a -c \/etc\/rndc.key\nwrote key file \"\/etc\/rndc.key\"\n<\/pre>\n<p>4. View the content of the RNDC key :<\/p>\n<pre>\n[root@rhel6 ~]# cat \/etc\/rndc.key\nkey \"rndc-key\" {\n        algorithm hmac-md5;\n        secret \"rDy6d+XB4NiAnHWA5N7Jig==\";\n};\n<\/pre>\n<p>5. Edit the \/var\/named\/chroot\/etc\/named.conf file for bloggerbaru.local :<\/p>\n<pre>\n[root@rhel6 ~]# vi \/var\/named\/chroot\/etc\/named.conf\n<\/pre>\n<pre>\noptions {\n       directory \"\/var\/named\";\n       dump-file \"\/var\/named\/data\/cache_dump.db\";\n       statistics-file \"\/var\/named\/data\/named_stats.txt\";\nforwarders { 8.8.8.8; };\n};\ninclude \"\/etc\/rndc.key\";\n\/\/ We are the master server for bloggerbaru.local\n\nzone \"bloggerbaru.local\" {\n    type master;\n    file \"bloggerbaru.local\";\n};\n<\/pre>\n<p>6. Start the DNS service using the following command :<\/p>\n<pre>\n[root@rhel6 ~]# \/etc\/init.d\/named start\nStarting named:                                            [  OK  ]\n<\/pre>\n<p>7. To ensure the named daemon will start at boot, execute the following chkconfig :<\/p>\n<pre>\n[root@rhel6 ~]# chkconfig named on\n<\/pre>\n<p>8. Before testing, make sure your pc or server pointing to the DNS Server that has been set up :<\/p>\n<pre>\n[root@rhel6 ~]# cat \/etc\/resolv.conf\nnameserver 192.168.1.43\n<\/pre>\n<p>9. Test your DNS service :<\/p>\n<pre>\n[root@rhel6 ~]# host -t mx bloggerbaru.local\nbloggerbaru.local mail is handled by 10 mail.bloggerbaru.local.\n<\/pre>\n<pre>\n[root@rhel6 ~]# host -t ns bloggerbaru.local\nbloggerbaru.local name server ns.bloggerbaru.local.\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In this post, i will guide you on how to install and configure Bind Chroot DNS server on Redhat Enterprise Linux 6 (RHEL 6). DNS is the Domain Name System&#8230;<\/p>\n","protected":false},"author":6,"featured_media":1499,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1138,2058],"tags":[1337,1536,1546,1715],"class_list":["post-2265","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dns","category-rhel","tag-dns","tag-linux","tag-linux-utilities","tag-rhel-6"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=2265"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2265\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/1499"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=2265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=2265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=2265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}