Why do I get ‘host not found’ errors? Well…

A friend asked me today if I know about DNS Servers. “Yeah, I do. Can I help with something” I wrote back? She wrote this:

For example, in my browser I can type in www.espn.com and when the DNS server does not work, an error message states that the web site could not be found. If I hit refresh on my browser, the web site then loads as normal. This happens randomly. Sometimes the web site loads as normal, sometimes it does not load. Hitting the refresh button one or more times fixes the problem.

She asked it well and I was pleased to read such a clear question. Here’s what I wrote back and maybe it’ll help you understand this problem too:

When you put a URL in your browser, this happens:

  1. browser asks computer to connect to www.host.com
  2. computer asks local DNS server for the IP address of www.host.com
  3. if the local DNS server has that IP cached it responds immediately (hundredths of a second) but if not, it has to ask other DNS servers and the answer to your computer may be delayed by tenths of a second, possible even seconds.
  4. local DNS server sends the IP address to your computer
  5. your computer opens a connection to that IP address on port 80 (HTTP, 443 for HTTPS)
  6. your computer reports to the browser that it’s ready
  7. your browser sends a request over the connection (GET / HTTP/1.0) to the web server
  8. the web server sends an answer to your browser over the same connection
  9. that answer likely contains a large number of other URLs, for images, CSS style sheets, external Javascript files, etc., requiring this cycle be repeated many times for each page.

If the DNS server’s delays too long in responding to your computer’s request for an IP address lookup, your browser will tell you that, albeit in code, by showing you the “host not found” page.

So, there you are. The next question is probably going to be why would there be delays in getting an answer from the DNS server? Ahhh… well….

Best,
Mike

Leave a Reply

You must be logged in to post a comment.