User login

Domain Name Server caching on personal computers

Perusing Yahoo's rules for speeding up your web site, I came across the explanation to an interesting phenomenon.

On Dan's computer, it can take hours after the DNS resolves on our ISP, for his computer to recognize it! (I have to out my co-collective member at Agaric: He still uses Microsoft Windows.)

Yahoo explains:

DNS lookups are cached for better performance. This caching can occur on a special caching server, maintained by the user's ISP or local area network, but there is also caching that occurs on the individual user's computer. The DNS information remains in the operating system's DNS cache (the "DNS Client service" on Microsoft Windows). Most browsers have their own caches, separate from the operating system's cache. As long as the browser keeps a DNS record in its own cache, it doesn't bother the operating system with a request for the record.

Internet Explorer caches DNS lookups for 30 minutes by default, as specified by the DnsCacheTimeout registry setting. Firefox caches DNS lookups for 1 minute, controlled by the network.dnsCacheExpiration configuration setting. (Fasterfox changes this to 1 hour.)

And here's a not entirely irrelevant IRC discussion Agaric had on the subject.

ben-agaric:
I had never heard of editing /etc/hosts on one's own computer before.
[
8:52pm
]
ReK2CaSa
:
so both domains go to the same server
[
8:52pm
]
ReK2CaSa
:
yes.. /etc/hosts is old school
[
8:52pm
]
ReK2CaSa
:
:-)
[
8:52pm
]
ReK2CaSa
:
before there were domain servers
[
8:53pm
]
ReK2CaSa
:
there was /etc/hosts
[
8:53pm
]
ReK2CaSa
:
now a days is still in use for local stuff
[
8:53pm
]
ReK2CaSa
:
lolca localhost is there
[
8:53pm
]
ReK2CaSa
:
*like
[
8:53pm
]
ReK2CaSa
:
but you can add anything
[
8:53pm
]
ReK2CaSa
:
and it takes precendense to DNS servers
[
8:53pm
]
ReK2CaSa
:
so if I add to my local host 127.0.0.1 microsoft.com www.microsoft.com
[
8:54pm
]
ReK2CaSa
:
and I go to my browser and type that domain, I hit my own local computer
[
8:54pm
]
ReK2CaSa
:
basically the rules goes:
[
8:54pm
]
ReK2CaSa
:
programs look first for local /etc/hosts file
[
8:54pm
]
ReK2CaSa
:
if the entry is not there
[
8:54pm
]
ReK2CaSa
:
then to checks the dns servers of the domain
[
8:54pm
]
ReK2CaSa
:
and does a request to one of those
[
8:55pm
]
ben-agaric
:
Well, you may be glad to know that however this is done in Windows, Microsoft has screwed it up royally--- it must cache or something, because my spirit-is-willing-but-the-flesh-is-weak co-collective member can take hours after the DNS resolves to our ISP, for his computer to recognize it!
[
8:55pm
]
ReK2CaSa
:
this is why domains must have at least two, primary and secondary
[
8:55pm
]
ben-agaric
:
That's very cool.
[
8:55pm
]
ReK2CaSa
:
lol
[
8:55pm
]
ReK2CaSa
:
yap M$ sucks
[
8:55pm
]
ReK2CaSa
:
lol
[
8:55pm
]
ReK2CaSa
:
but it is because his ISP may have a long cache time
[
8:56pm
]
ben-agaric
:
No-- I'm plugged in right next to him!
[
8:56pm
]
ReK2CaSa
:
next time have him change his dns servers to yours
[
8:56pm
]
ben-agaric
:
It drives him insane!
[
8:56pm
]
ReK2CaSa
:
LOL
[
8:56pm
]
ReK2CaSa
:
LMAO
[
8:56pm
]
ben-agaric
:
My ISP at home is the slowest in the universe, so I know all about different ISP times.
[
8:56pm
]
ReK2CaSa
:
hehe
[
8:57pm
]
ReK2CaSa
:
you can sometimes force the expire on the dns records
[
8:57pm
]
ReK2CaSa
:
but that will not always work
[
8:57pm
]
ReK2CaSa
:
this is why they tell you from 1 to 7 days
[
8:57pm
]
ReK2CaSa
:
to propagate
[
8:57pm
]
ReK2CaSa
:
some people get it right away others take 2-3 days

HOWTO: Editing /etc/hosts
http://ubuntuforums.org/showthread.php?t=3407

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.