Speeding Up DNS Access In Regions With Very Low Infrastructure
Speeding Up DNS Access In Regions With Very Low InfrastructureIntroductionLet's say you are on an expensive satellite link that can barely provide enough bandwidth for your company's Internet access and you will want to do whatever you can to get as much as possible out of this link. Moreover, occassionally you lose power from the utility company, long enough for your UPS to run out. There are a few things you could do to get a lot more from your link. In this article, we will be looking at speeding up your dns requests by keeping a cache of responses to your dns requests on your hard disk. Subsequent dns request are then served from the cache and because a copy is on disk, you don't lose it when there is a power outage or a reboot. The updated version of this document is at: www.httpcompression.net.
AnalysisDo I need this? Well let's see. From your Linux issue the following command: dig www.httpcompression.net Among other things I get the following result: ;; Query time: 583 msec After a few seconds I issued the command again and got: ;; Query time: 612 msec Obviously my ISP's dns servers simply forwards the requests to the US (I am in Accra, Ghana, West Africa, connecting to the Internet over submarine fibre optic cable SAT3). Apparently, the results of the first request was not cached. If it was, it had timed out by the time of the second request. Certainly, such an environment is a perfect candidate for this setup.
HowToI am working on an Ubuntu server. The software we will be using is pdnsd. The website has this to say about pdnsd: "pdnsd is a proxy DNS server with permanent caching (the cache contents are written to hard disk on exit) that is designed to cope with unreachable or down DNS servers (for example in dial-in networking). Since version 1.1.0, pdnsd supports negative caching." From your Ubuntu or any other Debian based distribution issue the following command: apt-get install pdnsd A configuration page came up with three options "resolvconf / Use root servers / Manual". I selected "Manual" and continued with the installation. The default installation has a configuration file, parts of which have been remarked. A line is remarked out with "//" whilslt multilines are remarked with "/* */". Eg:" // This is a remarked line in the conf file. /* These are remarked lines in the coniguration file. */ Use your favourite text editor to edit the following configuration files:
Tests And ConclusionNow start you pdnsd server: /etc/init.d/pdnsd start Now issue the following command and look out for the Query time: in the response to determine how well you are doing: dig www.httpcompression.net ; DiG 9.4.2-P2 www.httpcompression.net ;; Query time: 3323 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Mon Nov 3 20:02:37 2008 ;; MSG SIZE rcvd: 71 After a while, issue the command again: dig www.httpcompression.net ; DiG 9.4.2-P2 www.httpcompression.net ;; Query time: 1 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Mon Nov 3 20:03:07 2008 ;; MSG SIZE rcvd: 71 From the two results above, the first query took 3323 msecs whilst the second, 30 seconds later, took only 1 msec to resolve. Now after a reboot of the server: dig www.httpcompression.net ;; Query time: 3 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Mon Nov 3 20:06:38 2008 ;; MSG SIZE rcvd: 71 After the reboot the query took only 3ms to resolve. We did not loose our cache. You may want to read the manual and change some settings to suit your situation. A few of these setting are:
|






Recent comments
10 hours 27 min ago
10 hours 32 min ago
11 hours 56 min ago
12 hours 44 min ago
13 hours 3 min ago
18 hours 34 min ago
23 hours 53 min ago
1 day 4 hours ago
1 day 10 hours ago
1 day 10 hours ago