Sunday, November 7, 2010

What is DNS prefetching and why it should be enabled

Earlier, I told you about the concept of DNS and how it works. If you haven't seen the article, it's worth checking out. Now, I'll explain what is DNS Prefetching and why web browser makers include it in the major features of their browsers.

Credit: NG Online
Suppose you are on a website and are browsing around. To get to a website, you have already used DNS. (If you don't know how, I really recommend going back to the article that comes before this in the series, linked above.) Now, you click a link. Once again, the IP lookup procedure starts, which is explained in the previous article. When you click a link on the next page, DNS is used again.

Though everything happens so fast, all this time when requests go back and forth, fractions of seconds are wasted. But then, DNS prefetching comes to the rescue.

In almost all major browsers' latest versions, DNS prefetching is available. And most of the time, it is enabled by default. What the browser does when this setting is enabled is that it prefetches all the IP addresses of the other pages that are linked to from the page you are on. So, when you are reading an article or something, your browser looks up all the IP addresses of the (probably) other articles linked to from the article you are on, and when you click any of the links, it doesn't have to waste time sending requests back and forth between the ISP, the DNS server and all of that stuff.

So, it increases your web browsing speed in a way. Note that your download speed remains the same. The pages will load at the same speed, but the IP address has been already looked up earlier, so this will save you upto a second or two when going from page to page, which is quite a lot.

So, that was all about DNS prefetching. Next time, I'll write about using alternate DNS servers to your advantage, instead of the one your ISP has assigned to you, and thus speed up web browsing, virtually, but by a lot.
Update: Here's the next article in the series (really useful one). If you haven't read the previous post yet, click here.

So, if you don't want to miss out that article, I recommend that you subscribe to this blog. See this page. You have multiple options.