View Single Post
  #21  
Old June 30th 16, 05:24 PM posted to alt.windows7.general
Char Jackson
external usenet poster
 
Posts: 10,449
Default Why does Firefox not respect the HOSTS file in Windows

On Thu, 30 Jun 2016 04:46:52 +0000 (UTC), Jannah Jankowski
wrote:

BTW, with regard to the whole "DNS caching thing" I am not the expert, so
I can only conjecture how I think it works.

1. You type www.somewhere.com along with http (i.e., port 80)
2. Firefox checks the Firefox DNS cache, but it's not there
3. Firefox checks the Windows DNS cache, but it's not there
4. So Windows first checks the HOSTS file, but it's not there
5. Then Windows checks the Windows DNS cache, but it's not there
6. So Windows checks what the DNS server is
7. For me, that's gonna be set to the router 192.168.1.1
8. So Windows asks 192.168.1.1 who the DNS Server is
9. The router returns the Google DNS Server 8.8.8.8
10. So Windows sends a port 53? DNS request to 8.8.8.8
11. (It actually follows a hierarchy so let's simplify here.)
12. 8.8.8.8 returns the IP address 1.2.3.4 to the DNS cache
13. 1.2.3.4 is handed back to to Windows from 8.8.8.8
14. Windows puts www.somewhere.com=1.2.3.4 into the Windows DNS cache
15. Windows hands Firefox that information
16. Firefox puts www.somewhere.com=1.2.3.4 into the Firefox DNS cache
17. Firefox sends the port 80 request to 1.2.3.4
18. And 1.2.3.4 returns the information to Firefox

Upon the *next* invocation of the same URL...
1. You type www.somewhere.com along with http (i.e., port 80)
2. Firefox checks the Firefox DNS cache, and finds 1.2.3.4
17. Firefox sends the port 80 request to 1.2.3.4
18. And 1.2.3.4 returns the information to Firefox

That's how I *think* it goes.
The Firefox cache skips steps 3 to 16 above.

However, the whole firefox cache thing is confusing.
So this is just a guess.

I throw it out there for someone who actually knows what they're talking
about to clarify.


You can view the Windows DNS cache with the following command:

ipconfig /displaydns

By repeatedly running the following command, which simply pulls out the Time
To Live (TTL) values for easier visibility, you can see the TTL starting
values as well as seeing the TTL count down toward zero. When it hits zero,
the DNS entry is removed from the cache.

ipconfig /displaydns | find "Time To Live"

Lastly, for testing purposes, you can clear the Windows DNS cache with the
following command:

ipconfig /flushdns

There are no ill effects as a result of clearing the cache. It simply
rebuilds over time, as necessary.

--

Char Jackson
Ads