How can I store DNS cache in case the DNS server goes down?
I'm using OpenDNS's DNS servers. Today, it went down for half an hour. I'm wondering if I can store a cached copy of the DNS records of the websites that I visit often.
Google Chrome does this automatically. I was still able to use a few sites for a few minutes after OpenDNS went down, but Chrome only stores temporary cache.
I can't just copy down the websites's IP address because google.com and mail.google.com share the same IP. If I go to the IP, I go to google.com, not mail.google.com.
Solution 1:
Of course you can. In fact, you should.
We're not in the 1990s world of DOS and DOS-Windows 9x any more. Most people nowadays are running protected mode multitasking operating systems that are fully capable of running a proper DNS proxy server. Every machine running its own proxy DNS server was expected behaviour for high end workstations in decades past, but nowadays even the most entry level modern PC is fully capable of doing so. At the very least there should be one proxy DNS server on a LAN, even if not one per machine.
There are two types of proxy DNS server: resolving proxy DNS servers and forwarding proxy DNS servers. The former do the grunt work of query resolution, and the latter conditionally forward transactions to one or more of the former. OpenDNS provides you with a resolving proxy DNS server. What you want is a local caching forwarding proxy DNS server, that caches results locally, and only forwards things on cache misses. Your situation is one of the reasons why one uses forwarding proxy DNS servers: the link to the resolving proxy DNS server (or even the server itself) is unreliable, congested, slow, or expensive.
If you have one of the Unices, or Linux, then one or more DNS server softwares (Dan Bernstein's djbdns
, ISC's BIND, MaraDNS, and so forth) comes as a package with the operating system. If you have Windows NT Server, then Microsoft's DNS server comes as standard. In both cases, just install and configure the server software, telling it to forward transactions to OpenDNS.
If you have Windows NT Workstation, you'll have to obtain a DNS server software since none are packaged by Microsoft. However, if you have Windows NT Workstation, you also have a caching DNS client, a service that runs on the workstation (modern multitasking operating systems, remember?), which should already be ameliorating the problem somewhat. Make sure that you have enabled this.
On the gripping hand: If the people who publish the relevant DNS data decided that their data should have a TTL of 30 seconds, then no amount of caching (which will of course obey the TTL) will allow you to remember those data.
Further reading
- Jonathan de Boyne Pollard (2000). "content" and "proxy" DNS servers. Frequently Given Answers.
- Jonathan de Boyne Pollard (2004). What DNS query resolution is. Frequently Given Answers.
- Jonathan de Boyne Pollard (2003). Providing proxy DNS service with an all-the-hats-at-once DNS server software. Frequently Given Answers.
- Daniel J. Bernstein. How to run a forwarding cache on a home computer. djbdns.
- Microsoft corporation (2000). DNS Resolver Cache Service. TechNet.
- Thomas Lee and Joseph Davies (2000). Domain Name Service. Microsoft Windows 2000 TCP/IP Protocols and Services Technical Reference. Microsoft Press.
Solution 2:
The first thing to check is how you're connected to the Internet. For instance, you may be using a DD-WRT based router. That will run dnsmasq, which will do DNS caching for you.