{"id":2649,"date":"2012-05-12T09:11:31","date_gmt":"2012-05-12T01:11:31","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=2649"},"modified":"2023-04-28T09:49:17","modified_gmt":"2023-04-28T09:49:17","slug":"how-to-install-and-configure-bind-9-dns-on-centos-6-2-x86_64","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-and-configure-bind-9-dns-on-centos-6-2-x86_64\/","title":{"rendered":"How to Install and Configure Bind 9 DNS on CentOS 6.2 x86_64"},"content":{"rendered":"<p>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 &#8220;Berkeley Internet Name Domain&#8221; and it&#8217;s an implementation of the DNS protocols. In this post i will show the steps how to install and configure Bind 9 DNS service on linux CentOS 6.2 64 bit server. <\/p>\n<p>To install Bind 9 on linux CentOS 6.2 server, run the following command :<\/p>\n<pre>\n[root@CentOS6.2 ~]# yum install bind -y\n<\/pre>\n<p>Example :<\/p>\n<pre>\n[root@CentOS6.2 ~]# yum install bind -y\nLoaded plugins: fastestmirror, security\nLoading mirror speeds from cached hostfile\n * base: centos.biz.net.id\n * extras: centos.biz.net.id\n * updates: centos.idrepo.or.id\nSetting up Install Process\nResolving Dependencies\n--> Running transaction check\n---> Package bind.x86_64 32:9.7.3-8.P3.el6_2.2 will be installed\n--> Processing Dependency: bind-libs = 32:9.7.3-8.P3.el6_2.2 for package: 32:bind-9.7.3-8.P3.el6_2.2.x86_64\n--> Running transaction check\n---> Package bind-libs.x86_64 32:9.7.3-8.P3.el6 will be updated\n--> Processing Dependency: bind-libs = 32:9.7.3-8.P3.el6 for package: 32:bind-utils-9.7.3-8.P3.el6.x86_64\n---> Package bind-libs.x86_64 32:9.7.3-8.P3.el6_2.2 will be an update\n--> Running transaction check\n---> Package bind-utils.x86_64 32:9.7.3-8.P3.el6 will be updated\n---> Package bind-utils.x86_64 32:9.7.3-8.P3.el6_2.2 will be an update\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n====================================================================================================\n Package               Arch              Version                           Repository          Size\n====================================================================================================\nInstalling:\n bind                  x86_64            32:9.7.3-8.P3.el6_2.2             updates            3.9 M\nUpdating for dependencies:\n bind-libs             x86_64            32:9.7.3-8.P3.el6_2.2             updates            840 k\n bind-utils            x86_64            32:9.7.3-8.P3.el6_2.2             updates            178 k\n\nTransaction Summary\n====================================================================================================\nInstall       1 Package(s)\nUpgrade       2 Package(s)\n\nTotal download size: 4.9 M\nDownloading Packages:\n(1\/3): bind-9.7.3-8.P3.el6_2.2.x86_64.rpm                                    | 3.9 MB     01:16\n(2\/3): bind-libs-9.7.3-8.P3.el6_2.2.x86_64.rpm                               | 840 kB     00:15\n(3\/3): bind-utils-9.7.3-8.P3.el6_2.2.x86_64.rpm                              | 178 kB     00:02\n----------------------------------------------------------------------------------------------------\nTotal                                                                50 kB\/s | 4.9 MB     01:39\nwarning: rpmts_HdrFromFdno: Header V4 RSA\/SHA1 Signature, key ID c105b9de: NOKEY\nRetrieving key from file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-6\nImporting GPG key 0xC105B9DE:\n Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>\n Package: centos-release-6-2.el6.centos.7.x86_64 (@anaconda-CentOS-201112091719.x86_64\/6.2)\n From   : \/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-6\nRunning rpm_check_debug\nRunning Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n  Updating   : 32:bind-libs-9.7.3-8.P3.el6_2.2.x86_64                                           1\/5\n  Updating   : 32:bind-utils-9.7.3-8.P3.el6_2.2.x86_64                                          2\/5\n  Installing : 32:bind-9.7.3-8.P3.el6_2.2.x86_64                                                3\/5\n  Cleanup    : 32:bind-utils-9.7.3-8.P3.el6.x86_64                                              4\/5\n  Cleanup    : 32:bind-libs-9.7.3-8.P3.el6.x86_64                                               5\/5\n\nInstalled:\n  bind.x86_64 32:9.7.3-8.P3.el6_2.2\n\nDependency Updated:\n  bind-libs.x86_64 32:9.7.3-8.P3.el6_2.2           bind-utils.x86_64 32:9.7.3-8.P3.el6_2.2\n\nComplete!\n<\/pre>\n<p>2. Setup and configure zone with the name of example.com :<\/p>\n<pre>\n[root@CentOS6.2 ~]# vi \/var\/named\/example.com\n<\/pre>\n<p>Create example.com zone as below. You can have different IP addresses if you have installed separate mail server and DNS server :<\/p>\n<pre>\n;\n;       Addresses and other host information.\n;\n@       IN      SOA     example.com. hostmaster.example.com. (\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.example.com.\n               IN      A       192.168.1.20\n               IN      MX      10 mail.example.com.\n\nmail            IN      A       192.168.1.20\nns              IN      A       192.168.1.20\n<\/pre>\n<p>3. Add example zone below to named.conf. named.conf is main configuration file for bind dns server.<\/p>\n<pre>\nzone \"example.com\" {\n    type master;\n    file \"example.com\";\n};\n<\/pre>\n<p>Open named.conf :<\/p>\n<pre>\n[root@CentOS6.2 ~]# vi \/etc\/named.conf\n<\/pre>\n<p>Add zone &#8220;example.com&#8221; into the named.conf as below :<\/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\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.com\" {\n    type master;\n    file \"example.com\";\n};\n\ninclude \"\/etc\/named.rfc1912.zones\";\n<\/pre>\n<p>4. Start named service :<\/p>\n<pre>\n[root@CentOS6.2 ~]# service named start\n<\/pre>\n<p>or<\/p>\n<pre>\n[root@CentOS6.2 ~]# \/etc\/init.d\/named start\n<\/pre>\n<p>5. Configure \/etc\/resolv.conf to point to this bind dns server (192.168.1.20).<\/p>\n<p>6. Test your dns configuration whether working or not :<\/p>\n<pre>\n[root@CentOS6.2 ~]# host -t mx example.com\nexample.com mail is handled by 10 mail.example.com.\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8220;Berkeley Internet&#8230;<\/p>\n","protected":false},"author":6,"featured_media":1554,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2055],"tags":[1228,1244,1253,1337,1536,1546],"class_list":["post-2649","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","tag-bind","tag-centos","tag-centos-6-2","tag-dns","tag-linux","tag-linux-utilities"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2649","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=2649"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2649\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/1554"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=2649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=2649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=2649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}