{"id":3188,"date":"2012-05-20T00:23:30","date_gmt":"2012-05-19T16:23:30","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=3188"},"modified":"2023-04-28T09:49:16","modified_gmt":"2023-04-28T09:49:16","slug":"how-to-install-and-configure-bind-chroot-dns-server-on-fedora-16","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-and-configure-bind-chroot-dns-server-on-fedora-16\/","title":{"rendered":"How to Install and Configure Bind Chroot DNS Server on Fedora 16"},"content":{"rendered":"<p>DNS is the Domain Name System that maintains a database that can help user\u2019s computer to translate domain names such as www.ehowstuff.com to IP addresses such as 184.173.214.97. DNS on CentOS and Fedora is based on the named daemon, which is built on the BIND package developed through the Internet Software Consortium. (More information is available from the BIND home page at www.isc.org\/products\/BIND.) However, these are RPM packages associated with DNS. But not all required to build Bind Chroot DNS Server. bind Includes the basic name server software, including \/usr\/sbin\/named. bind-chroot Includes directories that isolate BIND in a so-called \u201cchroot jail,\u201d which limits access if DNS is compromised. In this post, i will guide you on how to install and configure Bind Chroot DNS server on linux Fedora 16 server.<\/p>\n<p>1. Simply run this command to install Bind Chroot DNS Server :<\/p>\n<pre>\n[root@fedora16 ~]# yum install bind-chroot -y\n<\/pre>\n<p>Examples :<\/p>\n<pre>\n[root@fedora16 ~]# yum install bind-chroot -y\nFedora16-Repository                                                          | 3.7 kB     00:00 ...\nSetting up Install Process\nResolving Dependencies\n--> Running transaction check\n---> Package bind-chroot.i686 32:9.8.2-1.fc16 will be installed\n--> Processing Dependency: bind = 32:9.8.2-1.fc16 for package: 32:bind-chroot-9.8.2-1.fc16.i686\n--> Running transaction check\n---> Package bind.i686 32:9.8.2-1.fc16 will be installed\n--> Processing Dependency: bind-libs = 32:9.8.2-1.fc16 for package: 32:bind-9.8.2-1.fc16.i686\n--> Processing Dependency: liblwres.so.80 for package: 32:bind-9.8.2-1.fc16.i686\n--> Processing Dependency: libisccfg.so.82 for package: 32:bind-9.8.2-1.fc16.i686\n--> Processing Dependency: libisccc.so.80 for package: 32:bind-9.8.2-1.fc16.i686\n--> Processing Dependency: libisc.so.83 for package: 32:bind-9.8.2-1.fc16.i686\n--> Processing Dependency: libdns.so.81 for package: 32:bind-9.8.2-1.fc16.i686\n--> Processing Dependency: libbind9.so.80 for package: 32:bind-9.8.2-1.fc16.i686\n--> Running transaction check\n---> Package bind-libs.i686 32:9.8.2-1.fc16 will be installed\n--> Processing Dependency: bind-license = 32:9.8.2-1.fc16 for package: 32:bind-libs-9.8.2-1.fc16.i686\n--> Running transaction check\n---> Package bind-license.noarch 32:9.8.1-2.fc16 will be updated\n--> Processing Dependency: bind-license = 32:9.8.1-2.fc16 for package: 32:bind-libs-lite-9.8.1-2.fc16.i686\n---> Package bind-license.noarch 32:9.8.2-1.fc16 will be an update\n--> Running transaction check\n---> Package bind-libs-lite.i686 32:9.8.1-2.fc16 will be updated\n---> Package bind-libs-lite.i686 32:9.8.2-1.fc16 will be an update\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n====================================================================================================\n Package                   Arch              Version                       Repository          Size\n====================================================================================================\nInstalling:\n bind-chroot               i686              32:9.8.2-1.fc16               updates             71 k\nInstalling for dependencies:\n bind                      i686              32:9.8.2-1.fc16               updates            2.0 M\n bind-libs                 i686              32:9.8.2-1.fc16               updates            860 k\nUpdating for dependencies:\n bind-libs-lite            i686              32:9.8.2-1.fc16               updates            621 k\n bind-license              noarch            32:9.8.2-1.fc16               updates             72 k\n\nTransaction Summary\n====================================================================================================\nInstall       3 Packages\nUpgrade       2 Packages\n\nTotal download size: 3.6 M\nDownloading Packages:\n(1\/5): bind-9.8.2-1.fc16.i686.rpm                                            | 2.0 MB     00:18\n(2\/5): bind-chroot-9.8.2-1.fc16.i686.rpm                                     |  71 kB     00:00\n(3\/5): bind-libs-9.8.2-1.fc16.i686.rpm                                       | 860 kB     00:07\n(4\/5): bind-libs-lite-9.8.2-1.fc16.i686.rpm                                  | 621 kB     00:04\n(5\/5): bind-license-9.8.2-1.fc16.noarch.rpm                                  |  72 kB     00:00\n----------------------------------------------------------------------------------------------------\nTotal                                                               113 kB\/s | 3.6 MB     00:32\nRunning Transaction Check\nRunning Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n  Updating   : 32:bind-license-9.8.2-1.fc16.noarch                                              1\/7\n  Installing : 32:bind-libs-9.8.2-1.fc16.i686                                                   2\/7\n  Installing : 32:bind-9.8.2-1.fc16.i686                                                        3\/7\n  Installing : 32:bind-chroot-9.8.2-1.fc16.i686                                                 4\/7\n  Updating   : 32:bind-libs-lite-9.8.2-1.fc16.i686                                              5\/7\n  Cleanup    : 32:bind-libs-lite-9.8.1-2.fc16.i686                                              6\/7\n  Cleanup    : 32:bind-license-9.8.1-2.fc16.noarch                                              7\/7\n\nInstalled:\n  bind-chroot.i686 32:9.8.2-1.fc16\n\nDependency Installed:\n  bind.i686 32:9.8.2-1.fc16                      bind-libs.i686 32:9.8.2-1.fc16\n\nDependency Updated:\n  bind-libs-lite.i686 32:9.8.2-1.fc16              bind-license.noarch 32:9.8.2-1.fc16\n\nComplete!\n<\/pre>\n<p>2. Create a file \/var\/named\/chroot\/var\/named\/fedora16.local with the following configuration:<\/p>\n<pre>\n[root@fedora16 ~]# vi \/var\/named\/chroot\/var\/named\/fedora16.local\n<\/pre>\n<p>Examples :<\/p>\n<pre>\n;\n;       Addresses and other host information.\n;\n@       IN      SOA     fedora16.local. hostmaster.fedora16.local. (\n                               2012051901      ; 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.fedora16.local.\n               IN      A       192.168.1.47\n               IN      MX      10 mail.fedora16.local.\n\nmail            IN      A       192.168.1.51\nns              IN      A       192.168.1.47\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 To do this we use the following command :<\/p>\n<pre>\n[root@fedora16 ~]# rndc-confgen -a -c \/etc\/rndc.key\nwrote key file \"\/etc\/rndc.key\"\n<\/pre>\n<p>View the content of the RNDC key :<\/p>\n<pre>\n[root@fedora16 ~]# cat \/etc\/rndc.key\n<\/pre>\n<pre>\nkey \"rndc-key\" {\n        algorithm hmac-md5;\n        secret \"B2rQEFnrdcAzAt2BiUmBug==\";\n};\n<\/pre>\n<p>4. Edit the \/var\/named\/chroot\/etc\/named.conf file for fedora16.local<\/p>\n<pre>\n[root@fedora16 ~]# 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 fedora16.local\n\nzone \"fedora16.local\" {\n    type master;\n    file \"fedora16.local\";\n};\n<\/pre>\n<p>5. Start the DNS service using the following command :<\/p>\n<pre>\n[root@fedora16 ~]# \/etc\/init.d\/named start\nStarting named (via systemctl):                            [  OK  ]\n<\/pre>\n<p>6. Make named daemon auto start during boot :<\/p>\n<pre>\n[root@fedora16 ~]# chkconfig named on\n<\/pre>\n<p>7. Before testing, make sure your pc or server using the Bind Chroot DNS Server that has been set up :<\/p>\n<p>Test DNS using host command :<\/p>\n<pre>\n[root@fedora16 ~]# host -t mx fedora16.local\nfedora16.local mail is handled by 10 mail.fedora16.local.\n<\/pre>\n<p>Test DNS using nslookup command :<\/p>\n<pre>\n[root@fedora16 ~]# nslookup\n> ns.fedora16.local\nServer:         127.0.0.1\nAddress:        127.0.0.1#53\n\nName:   ns.fedora16.local\nAddress: 192.168.1.47\n> mail.fedora16.local\nServer:         127.0.0.1\nAddress:        127.0.0.1#53\n\nName:   mail.fedora16.local\nAddress: 192.168.1.51\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>DNS is the Domain Name System that maintains a database that can help user\u2019s computer to translate domain names such as www.ehowstuff.com to IP addresses such as 184.173.214.97. DNS on&#8230;<\/p>\n","protected":false},"author":6,"featured_media":2351,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1111,1138],"tags":[1228,1280,1337,1371,1536,1546],"class_list":["post-3188","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bind9","category-dns","tag-bind","tag-chroot","tag-dns","tag-fedora-16","tag-linux","tag-linux-utilities"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/3188","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=3188"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/3188\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/2351"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=3188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=3188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=3188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}