Dot Net Perls

Google Chrome DNS Lookups

by Sam Allen - Updated June 10, 2009

Problem. You want to know how DNS lookups for subdomains on your website can affect its performance. Use Google Chrome's about:dns feature to see DNS lookup times. Solution. Here we take a look at the about:dns feature in Google Chrome, and discuss what it means about subdomains, with a focus on website performance.

Google Chrome about:dns

1. Looking at subdomains

As a reminder, a subdomain is a DNS domain that is "part of a larger domain." Wikipedia provides the examples "mail.example.com" and "calendar.example.com" as possible subdomains. [Domain Name System - wikipedia.org]

2. Using Google Chrome

Subdomains must be fetched from your DNS server separately from the main domain. In this way, they are an entirely different domain. This incurs a performance cost. What I show in the screenshot is Google Chrome's about:dns screen showing the Applicable Prefetch Time (ms) for several subdomains.

Subdomains require time to fetch them from the DNS server, which Google Chrome prefetches. However, this prefetching is mainly useful for people who have already visited the site. [DNS Prefetching (or Pre-Resolving) - Chromium Blog]

3. Eliminating requests—favicon.ico

Almost all modern browsers request the file favicon.ico in the top level of every domain. This wastes lots of bandwidth for every visitor. Subdomains just make it worse because the browsers will request favicon.ico for your subdomains separately.

4. Modeling subdomain visits

Let's think of a visitor to dotnetperls.com. The visitor arrives from Google and reads an article. Next, she clicks on the link to my subdomain code.dotnetperls.com. The subdomain incurs two more trips over the network for the visitor. The favicon.ico is requested again, and the DNS record is fetched. This slows down the user experience of the pages, and costs me extra because of the extra favicon.ico request.

5. Avoiding HTTP requests

Web performance experts will tell you that minimizing HTTP requests from the browser is often the most important optimization for web pages. Performance expert Andy King writes about this, stating "the more HTTP requests that your pages require, the slower... their response time will be." [Minimize HTTP Requests - websiteoptimization.com]

6. Does Google Chrome solve DNS slowdowns?

No. However, it helps solve the slowdown for many sites. It isn't perfect, and the favicon.ico must still be fetched. Programs like Fasterfox also do prefetching, but the number of users running Fasterfox is small compared to people running regular browser setups.

7. Summary

Here we saw that you can avoid subdomains to minimize HTTP requests and reduce response times. This saves you money on bandwidth and makes your pages faster. You can use Google Chrome and its about:dns screen to see DNS statistics for your computer's network. The screenshot I showed above revealed very small times for DNS lookups, but this can vary greatly.

Dot Net Perls
Google | Google Analytics Load Time | Google Search Query | Google Webmaster Tools Crawl...
C# | Dictionary StringComparer Tip | DateTime.TryParse Example | Reflection Field Example | Validate Characters in String
© 2009 Sam Allen. All rights reserved.