{"id":2737,"date":"2012-04-08T16:25:15","date_gmt":"2012-04-08T08:25:15","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=2737"},"modified":"2023-09-18T16:09:54","modified_gmt":"2023-09-18T16:09:54","slug":"how-to-install-and-configure-bind-9-as-a-caching-server-on-ubuntu-11-10","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-and-configure-bind-9-as-a-caching-server-on-ubuntu-11-10\/","title":{"rendered":"How to Install and Configure Bind 9 as a Caching Server on Ubuntu 11.10"},"content":{"rendered":"<p>BIND, standing for &#8220;Berkeley Internet Name Domain&#8221;, is the most widely used Domain Name System software on the web, providing DNS services. It enables users to locate and access websites using human-friendly domain names instead of complex IP addresses.<\/p>\n<p>This tutorial will guide you through the process of installing and configuring BIND 9 on an <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-ubuntu-beginners-guide-ubuntu-linux-distro\/\">Ubuntu<\/a> 11.10 Linux server to function as a caching server. A caching server is a type of server that stores web pages and other content locally, improving response times for future requests of the same content. By configuring BIND 9 as a caching server, you can enhance the efficiency of your network and provide faster response times for your users.<\/p>\n<p>For those who are interested in a deeper understanding of web servers, we recommend our comprehensive guide on the <a href=\"https:\/\/webhostinggeeks.com\/best\/web-server\/\">best web servers<\/a>. This guide provides a detailed overview of various web servers and their features, helping you make an informed decision when choosing a web server for your needs.<\/p>\n<h2>Installation of BIND 9<\/h2>\n<p>The first step in configuring BIND 9 as a caching server on Ubuntu 11.10 is to install the software. This can be done by executing the following command:<\/p>\n<pre>\r\nroot@ehowstuff:~# apt-get install bind9 -y\r\n<\/pre>\n<p>This command will install BIND 9 and its dependencies. The output will show the packages that will be upgraded, newly installed, and those that will not be upgraded.<\/p>\n<p>Example:<\/p>\n<pre>\r\nroot@ehowstuff:~# apt-get install bind9 -y\r\nReading package lists... Done\r\nBuilding dependency tree\r\nReading state information... Done\r\nThe following extra packages will be installed:\r\n  bind9-host bind9utils dnsutils libbind9-60 libcap2 libdns69 libisc62 libisccc60 libisccfg62\r\n  liblwres60\r\nSuggested packages:\r\n  bind9-doc resolvconf rblcheck\r\nThe following NEW packages will be installed:\r\n  bind9 bind9utils libcap2\r\nThe following packages will be upgraded:\r\n  bind9-host dnsutils libbind9-60 libdns69 libisc62 libisccc60 libisccfg62 liblwres60\r\n8 upgraded, 3 newly installed, 0 to remove and 56 not upgraded.\r\nNeed to get 1,592 kB of archives.\r\nAfter this operation, 1,479 kB of additional disk space will be used.\r\nGet:1 http:\/\/sg.archive.ubuntu.com\/ubuntu\/ oneiric-updates\/main dnsutils i386 1:9.7.3.dfsg-1ubuntu4.1 [142 kB]\r\nGet:2 http:\/\/sg.archive.ubuntu.com\/ubuntu\/ oneiric-updates\/main bind9-host i386 1:9.7.3.dfsg-1ubuntu4.1 [53.9 kB]\r\nGet:3 http:\/\/sg.archive.ubuntu.com\/ubuntu\/ oneiric-updates\/main libisc62 i386 1:9.7.3.dfsg-1ubuntu4.1 [160 kB]\r\nGet:4 http:\/\/sg.archive.ubuntu.com\/ubuntu\/ oneiric-updates\/main libdns69 i386 1:9.7.3.dfsg-1ubuntu4.1 [676 kB]\r\nGet:5 http:\/\/sg.archive.ubuntu.com\/ubuntu\/ oneiric-updates\/main libisccc60 i386 1:9.7.3.dfsg-1ubuntu4.1 [18.0 kB]\r\nGet:6 http:\/\/sg.archive.ubuntu.com\/ubuntu\/ oneiric-updates\/main libisccfg62 i386 1:9.7.3.dfsg-1ubuntu4.1 [38.8 kB]\r\nGet:7 http:\/\/sg.archive.ubuntu.com\/ubuntu\/ oneiric-updates\/main liblwres60 i386 1:9.7.3.dfsg-1ubuntu4.1 [38.6 kB]\r\nGet:8 http:\/\/sg.archive.ubuntu.com\/ubuntu\/ oneiric-updates\/main libbind9-60 i386 1:9.7.3.dfsg-1ubuntu4.1 [23.0 kB]\r\nGet:9 http:\/\/sg.archive.ubuntu.com\/ubuntu\/ oneiric\/main libcap2 i386 1:2.21-2 [12.5 kB]\r\nGet:10 http:\/\/sg.archive.ubuntu.com\/ubuntu\/ oneiric-updates\/main bind9utils i386 1:9.7.3.dfsg-1ubuntu4.1 [102 kB]\r\nGet:11 http:\/\/sg.archive.ubuntu.com\/ubuntu\/ oneiric-updates\/main bind9 i386 1:9.7.3.dfsg-1ubuntu4.1 [327 kB]\r\nFetched 1,592 kB in 18s (88.4 kB\/s)\r\nPreconfiguring packages ...\r\n(Reading database ... 50749 files and directories currently installed.)\r\nPreparing to replace dnsutils 1:9.7.3.dfsg-1ubuntu4 (using ...\/dnsutils_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...\r\nUnpacking replacement dnsutils ...\r\nPreparing to replace bind9-host 1:9.7.3.dfsg-1ubuntu4 (using ...\/bind9-host_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...\r\nUnpacking replacement bind9-host ...\r\nPreparing to replace libisc62 1:9.7.3.dfsg-1ubuntu4 (using ...\/libisc62_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...\r\nUnpacking replacement libisc62 ...\r\nPreparing to replace libdns69 1:9.7.3.dfsg-1ubuntu4 (using ...\/libdns69_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...\r\nUnpacking replacement libdns69 ...\r\nPreparing to replace libisccc60 1:9.7.3.dfsg-1ubuntu4 (using ...\/libisccc60_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...\r\nUnpacking replacement libisccc60 ...\r\nPreparing to replace libisccfg62 1:9.7.3.dfsg-1ubuntu4 (using ...\/libisccfg62_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...\r\nUnpacking replacement libisccfg62 ...\r\nPreparing to replace liblwres60 1:9.7.3.dfsg-1ubuntu4 (using ...\/liblwres60_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...\r\nUnpacking replacement liblwres60 ...\r\nPreparing to replace libbind9-60 1:9.7.3.dfsg-1ubuntu4 (using ...\/libbind9-60_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...\r\nUnpacking replacement libbind9-60 ...\r\nSelecting previously deselected package libcap2.\r\nUnpacking libcap2 (from ...\/libcap2_1%3a2.21-2_i386.deb) ...\r\nSelecting previously deselected package bind9utils.\r\nUnpacking bind9utils (from ...\/bind9utils_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...\r\nSelecting previously deselected package bind9.\r\nUnpacking bind9 (from ...\/bind9_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...\r\nProcessing triggers for man-db ...\r\nProcessing triggers for ufw ...\r\nProcessing triggers for ureadahead ...\r\nureadahead will be reprofiled on next reboot\r\nSetting up libisc62 (1:9.7.3.dfsg-1ubuntu4.1) ...\r\nSetting up libdns69 (1:9.7.3.dfsg-1ubuntu4.1) ...\r\nSetting up libisccc60 (1:9.7.3.dfsg-1ubuntu4.1) ...\r\nSetting up libisccfg62 (1:9.7.3.dfsg-1ubuntu4.1) ...\r\nSetting up libbind9-60 (1:9.7.3.dfsg-1ubuntu4.1) ...\r\nSetting up liblwres60 (1:9.7.3.dfsg-1ubuntu4.1) ...\r\nSetting up bind9-host (1:9.7.3.dfsg-1ubuntu4.1) ...\r\nSetting up dnsutils (1:9.7.3.dfsg-1ubuntu4.1) ...\r\nSetting up libcap2 (1:2.21-2) ...\r\nSetting up bind9utils (1:9.7.3.dfsg-1ubuntu4.1) ...\r\nSetting up bind9 (1:9.7.3.dfsg-1ubuntu4.1) ...\r\nAdding group `bind' (GID 113) ...\r\nDone.\r\nAdding system user `bind' (UID 105) ...\r\nAdding new user `bind' (UID 105) with group `bind' ...\r\nNot creating home directory `\/var\/cache\/bind'.\r\nwrote key file \"\/etc\/bind\/rndc.key\"\r\n#\r\n * Starting domain name service... bind9                                                     [ OK ]\r\nProcessing triggers for libc-bin ...\r\nldconfig deferred processing now taking place\r\n<\/pre>\n<h2>Configuration of BIND 9<\/h2>\n<p>The main configuration of BIND 9 is stored in the following files:<\/p>\n<pre>\r\nroot@ehowstuff:~# ls \/etc\/bind | grep named\r\nnamed.conf\r\nnamed.conf.default-zones\r\nnamed.conf.local\r\nnamed.conf.options\r\n<\/pre>\n<p>To configure BIND 9 to act as a caching server, you need to add the IP numbers of your ISP\u2019s DNS servers or alternatively, you can use free Google DNS server. This can be done by editing the following file:<\/p>\n<pre>\r\nroot@ehowstuff:~# vim \/etc\/bind\/named.conf.options\r\n<\/pre>\n<p>In the \/etc\/bind\/named.conf.options file, uncomment and edit the following section:<\/p>\n<pre>\r\nforwarders {\r\n 8.8.8.8;\r\n};\r\n<\/pre>\n<p>This configuration sets Google&#8217;s DNS server (8.8.8.8) as the forwarder.<\/p>\n<h2>Starting the BIND 9 Service<\/h2>\n<p>After the configuration, you need to start or restart the caching named service. This can be done as a root user or as a normal user.<\/p>\n<p>As a root user, execute the following command:<\/p>\n<pre>\r\nroot@ehowstuff:~# \/etc\/init.d\/bind9 restart\r\n * Stopping domain name service... bind9                                                     [ OK ]\r\n * Starting domain name service... bind9   \r\n<\/pre>\n<p>As a normal user, execute the following command:<\/p>\n<pre>\r\nehowstuff@ehowstuff:~$ sudo \/etc\/init.d\/bind9 restart\r\n[sudo] password for ehowstuff:\r\n * Stopping domain name service... bind9                                                     [ OK ]\r\n * Starting domain name service... bind9   \r\n<\/pre>\n<h2>Verification of the Caching DNS Server<\/h2>\n<p>To verify that the caching DNS server is working correctly, you can use the dig command to query a domain, for example, google.com:<\/p>\n<pre>\r\nroot@ehowstuff:~# dig www.google.com\r\n<\/pre>\n<p>The output will provide information about the query, including the status, flags, sections, query time, server, and message size.<\/p>\n<p>Example:<\/p>\n<pre>\r\nroot@ehowstuff:~# dig www.google.com\r\n\r\n; <<>> DiG 9.7.3 <<>> www.google.com\r\n;; global options: +cmd\r\n;; Got answer:\r\n;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40642\r\n;; flags: qr rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 13, ADDITIONAL: 0\r\n\r\n;; QUESTION SECTION:\r\n;www.google.com.                        IN      A\r\n\r\n;; ANSWER SECTION:\r\nwww.google.com.         86322   IN      CNAME   www.l.google.com.\r\nwww.l.google.com.       223     IN      A       209.85.175.99\r\nwww.l.google.com.       223     IN      A       209.85.175.103\r\nwww.l.google.com.       223     IN      A       209.85.175.104\r\nwww.l.google.com.       223     IN      A       209.85.175.105\r\nwww.l.google.com.       223     IN      A       209.85.175.106\r\nwww.l.google.com.       223     IN      A       209.85.175.147\r\n\r\n;; AUTHORITY SECTION:\r\n.                       14355   IN      NS      m.root-servers.net.\r\n.                       14355   IN      NS      l.root-servers.net.\r\n.                       14355   IN      NS      f.root-servers.net.\r\n.                       14355   IN      NS      d.root-servers.net.\r\n.                       14355   IN      NS      k.root-servers.net.\r\n.                       14355   IN      NS      j.root-servers.net.\r\n.                       14355   IN      NS      g.root-servers.net.\r\n.                       14355   IN      NS      h.root-servers.net.\r\n.                       14355   IN      NS      i.root-servers.net.\r\n.                       14355   IN      NS      a.root-servers.net.\r\n.                       14355   IN      NS      e.root-servers.net.\r\n.                       14355   IN      NS      b.root-servers.net.\r\n.                       14355   IN      NS      c.root-servers.net.\r\n\r\n;; Query time: 14 msec\r\n;; SERVER: 127.0.0.1#53(127.0.0.1)\r\n;; WHEN: Sun Apr  8 16:21:07 2012\r\n;; MSG SIZE  rcvd: 359\r\n<\/pre>\n<h2>Commands Mentioned<\/h2>\n<ul>\n<li><span class=\"fw-bold\">apt-get install bind9 -y<\/span> \u2013 Installs BIND 9 and its dependencies<\/li>\n<li><span class=\"fw-bold\">ls \/etc\/bind | grep named<\/span> \u2013 Lists the main configuration files for BIND 9<\/li>\n<li><span class=\"fw-bold\">vim \/etc\/bind\/named.conf.options<\/span> \u2013 Opens the named.conf.options file for editing<\/li>\n<li><span class=\"fw-bold\">\/etc\/init.d\/bind9 restart<\/span> \u2013 Restarts the BIND 9 service<\/li>\n<li><span class=\"fw-bold\">dig www.google.com<\/span> \u2013 Queries the domain www.google.com to verify the caching DNS server<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>BIND 9 is a powerful tool for managing DNS services, and configuring it as a caching server can significantly improve response times for DNS queries. This tutorial has guided you through the process of installing and configuring BIND 9 on an Ubuntu 11.10 server, and verifying its operation.<\/p>\n<p>For more information on various types of web servers like <a href=\"https:\/\/webhostinggeeks.com\/blog\/apache-http-server-explained\/\">Apache<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/nginx-server-explained\/\">Nginx<\/a>, and <a href=\"https:\/\/webhostinggeeks.com\/blog\/litespeed-web-server-explained\/\">LiteSpeed<\/a>, you can refer to our detailed guides. If you're interested in different types of hosting, we also have comprehensive articles on <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-dedicated-server-hosting\/\">dedicated server<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-vps-hosting\/\">VPS server<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-cloud-hosting\/\">cloud hosting<\/a>, and <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-shared-hosting\/\">shared hosting<\/a>.<\/p>\n<p>Remember, the key to successful server management is understanding the tools at your disposal and how to use them effectively. By following the steps outlined in this tutorial, you can set up a caching server that improves your network's efficiency and response times.<\/p>\n<h2>Frequently Asked Questions<\/h2>\n<ol itemscope itemtype=\"https:\/\/schema.org\/FAQPage\">\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is BIND 9?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">BIND 9, standing for \"Berkeley Internet Name Domain\", is the most widely used Domain Name System (DNS) software on the Internet. It provides DNS services, allowing users to connect to websites using domain names instead of IP addresses.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is a caching server?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">A caching server is a server that saves web pages and other content locally. By storing this information in the cache, the server can improve response times for future requests of the same content.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">How do I install BIND 9 on Ubuntu 11.10?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can install BIND 9 on Ubuntu 11.10 by executing the command 'apt-get install bind9 -y' as a root user. This command will install BIND 9 and its dependencies.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">How do I configure BIND 9 as a caching server?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">To configure BIND 9 as a caching server, you need to edit the \/etc\/bind\/named.conf.options file and add the IP numbers of your ISP\u2019s DNS servers or use a free DNS server like Google's (8.8.8.8) in the 'forwarders' section.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">How do I verify that the caching DNS server is working?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can verify that the caching DNS server is working correctly by using the 'dig' command to query a domain. For example, 'dig www.google.com' will provide information about the query, including the status, flags, sections, query time, server, and message size.<\/span>\n            <\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>BIND, standing for &#8220;Berkeley Internet Name Domain&#8221;, is the most widely used Domain Name System software on the web, providing DNS services. It enables users to locate and access websites&#8230;<\/p>\n","protected":false},"author":6,"featured_media":2682,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1138,1073],"tags":[1228,1337,1511,1536,1546,1856,1857,1862],"class_list":["post-2737","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dns","category-ubuntu","tag-bind","tag-dns","tag-internet","tag-linux","tag-linux-utilities","tag-ubuntu","tag-ubuntu-11-10","tag-ubuntu-server-11-10"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2737","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=2737"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2737\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/2682"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=2737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=2737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=2737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}