DNS lookup

Skip to first unread message


Dec 9, 2008, 3:21:29 AM12/9/08
to CS193H High Performance Web Sites
Should the initial DNS lookup happen before html document downloading
or after that? I noticed that in the Chapter 15 of HPWS, for
amazon.com, aol.com, ebay.com, msn.com, myspace.com, the illustrations
show DNS lookup happened after the html document started to download.
But for yahoo.com, it shows DNS lookup happened before the html
document started to download.

Tony Wu

Dec 9, 2008, 3:26:15 AM12/9/08
to cs193...@googlegroups.com
That's strange. These DNS lookups are for the domains of the document's resources, so I can't imagine it happening before the HTML download even starts. My guess is that maybe the yahoo one had a redirect, and that the initial DNS lookup before the HTML doc is for the redirected domain?


Wuping Lu

Dec 9, 2008, 3:41:05 AM12/9/08
to cs193...@googlegroups.com
When you type www.yahoo.com into your browser, a DNS resolver is
contacted by the browser and returns the server's IP address. it
typically takes 20-120 milliseconds for the browser to look up the IP
address for a given hostname. The browser can't download anything from
this hostname until the DNS lookup is complete. My understanding is
that this DNS lookup should happen even before you download the html
document (not the components in this document) you are requesting -
the browser needs to first find out where it is and then it can
download it.

Tony Wu

Dec 9, 2008, 3:45:01 AM12/9/08
to cs193...@googlegroups.com
That's what I thought at first too, but if you look at the timing charts, it doesn't seem that way. For instance, on page 109 on Amazon's chart, the first DNS lookup shown in done when the html doc already loaded about 80%. On page 111, AOL's chart's first DNS lookup doesn't start at all until the html document is completely done. This leads me to think that the DNS lookup times shown here are only for the resources referenced from the html document, and do not include the initial DNS lookup for the website's domain itself.


Steve Souders

Dec 9, 2008, 4:00:17 AM12/9/08
to cs193...@googlegroups.com
DNS happens before the request.

With an empty DNS cache (in the browser and OS) all of the charts should have looked like Yahoo's. But I must have done the screenshots *after* priming the DNS cache. When I did Yahoo's, the DNS cache must have just purged yahoo.com.

Reply all
Reply to author
0 new messages