{"id":3741,"date":"2012-08-07T23:03:29","date_gmt":"2012-08-07T15:03:29","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=3741"},"modified":"2023-04-28T09:49:00","modified_gmt":"2023-04-28T09:49:00","slug":"how-to-install-and-configure-bind-9-dns-on-centos-6-3","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-and-configure-bind-9-dns-on-centos-6-3\/","title":{"rendered":"How to Install and Configure Bind 9 DNS on CentOS 6.3"},"content":{"rendered":"<p><img decoding=\"async\" data-src=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/bind.jpg\" alt=\"bind\" title=\"bind\" width=\"139\" height=\"140\" class=\"alignleft size-full wp-image-3276 lazyload\" data-srcset=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/bind.jpg 139w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/bind-100x100.jpg 100w\" data-sizes=\"(max-width: 139px) 100vw, 139px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 139px; --smush-placeholder-aspect-ratio: 139\/140;\" \/>This post covers the steps on how to install Bind DNS server on CentOS 6.3. Bind is the most popular software and the most widely used Domain Name System (DNS) software on the Internet for providing DNS services. The name BIND stands for \u201cBerkeley Internet Name Domain\u201d and it\u2019s an implementation of the DNS protocols. <\/p>\n<p>1. To install Bind 9 on linux CentOS 6.3 server, run the following command :<\/p>\n<pre>\n[root@centos63 ~]# yum install bind -y\n<\/pre>\n<p>Examples :<\/p>\n<pre>\n[root@centos63 ~]# yum install bind -y\nLoaded plugins: fastestmirror, presto\nLoading mirror speeds from cached hostfile\n * base: ossm.utm.my\n * extras: ossm.utm.my\n * updates: ossm.utm.my\nCentOS6.3-Repository                                                         | 4.0 kB     00:00 ...\nSetting up Install Process\nResolving Dependencies\n--> Running transaction check\n---> Package bind.i686 32:9.8.2-0.10.rc1.el6_3.2 will be installed\n--> Processing Dependency: portreserve for package: 32:bind-9.8.2-0.10.rc1.el6_3.2.i686\n--> Running transaction check\n---> Package portreserve.i686 0:0.0.4-9.el6 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n====================================================================================================\n Package            Arch        Version                           Repository                   Size\n====================================================================================================\nInstalling:\n bind               i686        32:9.8.2-0.10.rc1.el6_3.2         updates                     4.0 M\nInstalling for dependencies:\n portreserve        i686        0.0.4-9.el6                       CentOS6.3-Repository         22 k\n\nTransaction Summary\n====================================================================================================\nInstall       2 Package(s)\n\nTotal download size: 4.0 M\nInstalled size: 7.2 M\nDownloading Packages:\nSetting up and reading Presto delta metadata\nupdates\/prestodelta                                                          | 104 kB     00:00\nProcessing delta metadata\nPackage(s) data still to download: 4.0 M\n(1\/2): bind-9.8.2-0.10.rc1.el6_3.2.i686.rpm                                  | 4.0 MB     00:43\n----------------------------------------------------------------------------------------------------\nTotal                                                                93 kB\/s | 4.0 MB     00:43\nRunning rpm_check_debug\nRunning Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n  Installing : portreserve-0.0.4-9.el6.i686                                                     1\/2\n  Installing : 32:bind-9.8.2-0.10.rc1.el6_3.2.i686                                              2\/2\n  Verifying  : portreserve-0.0.4-9.el6.i686                                                     1\/2\n  Verifying  : 32:bind-9.8.2-0.10.rc1.el6_3.2.i686                                              2\/2\n\nInstalled:\n  bind.i686 32:9.8.2-0.10.rc1.el6_3.2\n\nDependency Installed:\n  portreserve.i686 0:0.0.4-9.el6\n\nComplete!\n<\/pre>\n<p>2. Setup and configure zone with the name of example.local :<\/p>\n<pre>\n[root@centos63 ~]# vi \/var\/named\/example.local\n<\/pre>\n<p>Add zone record as below :<\/p>\n<pre>\n\n;\n;       Addresses and other host information.\n;\n$TTL 86400\n@       IN      SOA     example.local. hostmaster.example.local. (\n                               2012080701      ; 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.example.local.\n               IN      A       192.168.1.54\n               IN      MX      10 mail.example.local.\n\nmail            IN      A       192.168.1.51\nns              IN      A       192.168.1.54\nwww             IN      A       192.168.1.54\n\n<\/pre>\n<p>3. Add example.local zone below to named.conf. This is main configuration file for bind dns server.<\/p>\n<p>Modify named.conf :<\/p>\n<pre>\n[root@centos63 ~]# vi \/etc\/named.conf\n<\/pre>\n<p>Add the following :<\/p>\n<pre>\nzone \"example.local\" {\n    type master;\n    file \"\/var\/named\/example.local\";\n};\n<\/pre>\n<p>Full named.conf configuration file :<\/p>\n<pre>\n\/\/\n\/\/ named.conf\n\/\/\n\/\/ Provided by Red Hat bind package to configure the ISC BIND named(8) DNS\n\/\/ server as a caching only nameserver (as a localhost DNS resolver only).\n\/\/\n\/\/ See \/usr\/share\/doc\/bind*\/sample\/ for example named configuration files.\n\/\/\n\noptions {\n        listen-on port 53 { 127.0.0.1; };\n        listen-on-v6 port 53 { ::1; };\n        directory       \"\/var\/named\";\n        dump-file       \"\/var\/named\/data\/cache_dump.db\";\n        statistics-file \"\/var\/named\/data\/named_stats.txt\";\n        memstatistics-file \"\/var\/named\/data\/named_mem_stats.txt\";\n        allow-query     { localhost; };\n        recursion yes;\n\n        dnssec-enable yes;\n        dnssec-validation yes;\n        dnssec-lookaside auto;\n\n        \/* Path to ISC DLV key *\/\n        bindkeys-file \"\/etc\/named.iscdlv.key\";\n\n        managed-keys-directory \"\/var\/named\/dynamic\";\n};\n\nlogging {\n        channel default_debug {\n                file \"data\/named.run\";\n                severity dynamic;\n        };\n};\n\nzone \".\" IN {\n        type hint;\n        file \"named.ca\";\n};\n\nzone \"example.local\" {\n    type master;\n    file \"\/var\/named\/example.local\";\n};\n\ninclude \"\/etc\/named.rfc1912.zones\";\ninclude \"\/etc\/named.root.key\";\n\n<\/pre>\n<p>4. start Named service :<\/p>\n<pre>\n[root@centos63 ~]# \/etc\/init.d\/named start\nGenerating \/etc\/rndc.key:                                  [  OK  ]\nStarting named:                                            [  OK  ]\n<\/pre>\n<p>5. If you want to restart and check the named status, execute the following :<\/p>\n<pre>\n[root@centos63 ~]# \/etc\/init.d\/named restart\nStopping named: .                                          [  OK  ]\nStarting named:                                            [  OK  ]\n<\/pre>\n<pre>\n[root@centos63 ~]# \/etc\/init.d\/named status\nversion: 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.2\nCPUs found: 1\nworker threads: 1\nnumber of zones: 20\ndebug level: 0\nxfers running: 0\nxfers deferred: 0\nsoa queries in progress: 0\nquery logging is OFF\nrecursive clients: 0\/0\/1000\ntcp clients: 0\/100\nserver is up and running\nnamed (pid  2405) is running...\n<\/pre>\n<p>6. For extra checking, verify mx record whether working or not :<\/p>\n<pre>\n[root@centos63 ~]# host -t mx example.local\nexample.local mail is handled by 10 mail.example.local.\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This post covers the steps on how to install Bind DNS server on CentOS 6.3. Bind is the most popular software and the most widely used Domain Name System (DNS)&#8230;<\/p>\n","protected":false},"author":6,"featured_media":3276,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1111,2055,1138],"tags":[1228,1244,1254,1337,1536,1546],"class_list":["post-3741","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bind9","category-centos","category-dns","tag-bind","tag-centos","tag-centos-6-3","tag-dns","tag-linux","tag-linux-utilities"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/3741","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=3741"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/3741\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/3276"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=3741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=3741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=3741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}