There is something fishy about my previous post in the Server Downtime thread with implementing DNS caching on my local mahine. It did in fact make a lot of difference in the response of this site. I have been trying to figure out why it did.
The web browser itself I believe does implement DNS caching, for a limited amount of time. Apparently current versions of Firefox cache DNS data for 60 seconds, while recent versions of IE cache for 30 minutes. Ii'm using Firefox, so if I spend more than a minute on a single page before clicking something else, the DNS cache will expire and the browser will have to do another lookup. These lookups for me were on the order of seconds, reason unknown. I believe the time can be changed in Firefox, but it is not readily apparent how to do that.
That amount of time that expires before it does another lookup is a parameter that can be set by the site being visited; in this case clubsearay.com. In fact, one can use the Unix dig command to query the clubsearay DNS server. In this case, @clubsearay tells dig to query that DNS server, and the clubsearay following is the name to ask about, again clubsearay. I had to specify where th query, as my system is now caching locally, and dig will by default look at the local cache.
dwm@EdgyEft:~$ dig @clubsearay.com www.clubsearay.com
; <<>> DiG 9.3.2 <<>> @clubsearay.com www.clubsearay.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11111
;; flags: qr aa rd; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;www.clubsearay.com. IN A
;; ANSWER SECTION:
www.clubsearay.com. 14400 IN CNAME clubsearay.com.
clubsearay.com. 14400 IN A 208.78.40.47
In the last line, I believe the 14400 is the number of seconds that clubsearay is requesting the DNS to be cached. This is 4 hours. If browsers would really follow this, it would reduce the workload on the DNS servers. I think this number is primarily intended the the chain of DNS servers on the internet.
If I do a default query, I will get the results from my local cache, like this:
dwm@EdgyEft:~$ dig clubsearay.com
...
;; ANSWER SECTION:
clubsearay.com. 10400 IN A 208.78.40.47
So, my local cache is counting down from 14400 as it should, and I just happened to query it 4000 seconds after it did the last lookup. Repeating the command does show it counting down.
So, bottom line for me with this is that Firefox does keep a local DNS cache, but for only a minute, not really long enough. Running a local cache really speeds things up, and the local cache does take directions from the DNS server for TTL. I was wondering yesterday after I turned it on whether it would hang on to an old invalid address, or what would cause it to time out. Now I know my local cache does comply with the Time To Live from the server, and that ClubSeaRay does have a reasonably long number set in the config files.
The web browser itself I believe does implement DNS caching, for a limited amount of time. Apparently current versions of Firefox cache DNS data for 60 seconds, while recent versions of IE cache for 30 minutes. Ii'm using Firefox, so if I spend more than a minute on a single page before clicking something else, the DNS cache will expire and the browser will have to do another lookup. These lookups for me were on the order of seconds, reason unknown. I believe the time can be changed in Firefox, but it is not readily apparent how to do that.
That amount of time that expires before it does another lookup is a parameter that can be set by the site being visited; in this case clubsearay.com. In fact, one can use the Unix dig command to query the clubsearay DNS server. In this case, @clubsearay tells dig to query that DNS server, and the clubsearay following is the name to ask about, again clubsearay. I had to specify where th query, as my system is now caching locally, and dig will by default look at the local cache.
dwm@EdgyEft:~$ dig @clubsearay.com www.clubsearay.com
; <<>> DiG 9.3.2 <<>> @clubsearay.com www.clubsearay.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11111
;; flags: qr aa rd; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;www.clubsearay.com. IN A
;; ANSWER SECTION:
www.clubsearay.com. 14400 IN CNAME clubsearay.com.
clubsearay.com. 14400 IN A 208.78.40.47
In the last line, I believe the 14400 is the number of seconds that clubsearay is requesting the DNS to be cached. This is 4 hours. If browsers would really follow this, it would reduce the workload on the DNS servers. I think this number is primarily intended the the chain of DNS servers on the internet.
If I do a default query, I will get the results from my local cache, like this:
dwm@EdgyEft:~$ dig clubsearay.com
...
;; ANSWER SECTION:
clubsearay.com. 10400 IN A 208.78.40.47
So, my local cache is counting down from 14400 as it should, and I just happened to query it 4000 seconds after it did the last lookup. Repeating the command does show it counting down.
So, bottom line for me with this is that Firefox does keep a local DNS cache, but for only a minute, not really long enough. Running a local cache really speeds things up, and the local cache does take directions from the DNS server for TTL. I was wondering yesterday after I turned it on whether it would hang on to an old invalid address, or what would cause it to time out. Now I know my local cache does comply with the Time To Live from the server, and that ClubSeaRay does have a reasonably long number set in the config files.
Last edited: