TTL = Time to Live. It's how long a record stays in cache. For instance, when you come to my site you typed
http://voidmain.is-a-geek.net/ into your browser. As you know in order to actually make a connection to my site your system has to be able to resolve my host name into an IP address. Assuming you are on a Windows machine you can do an "ipconfig /all" to see what DNS servers your PC is pointing to. Your machine asks the first DNS server in the list for an IP address for voidmain.is-a-geek.net. Chances are, the servers your client is pointing to is not authoritative for the is-a-geek.net domain so it has to ask the root servers responsible for the .net TLD (top level domain) for the authoritative server for is-a-geek.net. Once the root server gives your local DNS server that information it goes and queries the authoritative server for voidmain.is-a-geek.net and saves the record in it's own cache for the period of time specified in the TTL part of the record. That way it doesn't have to keep going out and asking the authoritative server as often. Usually static IP addresses will have a high TTL, at least day and very possibly more than that.
So if you do a "dig voidmain.is-a-geek.net" you will get something like this:
- Code: Select all
; <<>> DiG 9.2.1 <<>> voidmain.is-a-geek.net
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61508
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 2
;; QUESTION SECTION:
;voidmain.is-a-geek.net. IN A
;; ANSWER SECTION:
voidmain.is-a-geek.net. 60 IN A 24.171.59.228
;; AUTHORITY SECTION:
is-a-geek.net. 86400 IN NS ns1.dyndns.org.
is-a-geek.net. 86400 IN NS ns2.dyndns.org.
is-a-geek.net. 86400 IN NS ns3.dyndns.org.
is-a-geek.net. 86400 IN NS ns4.dyndns.org.
is-a-geek.net. 86400 IN NS ns5.dyndns.org.
;; ADDITIONAL SECTION:
ns1.dyndns.org. 85850 IN A 66.151.188.43
ns3.dyndns.org. 85850 IN A 64.152.102.41
;; Query time: 57 msec
;; SERVER: 192.168.0.3#53(192.168.0.3)
;; WHEN: Mon Jul 28 21:46:36 2003
;; MSG SIZE rcvd: 188
I run my own DNS server in my house (192.168.0.3) so that is what my DNS server thinks my IP address is. This is actually a bad example because I have a dynamic IP address and you can see the TTL for my record is only 60 seconds. That means that voidmain.is-a-geek.net should only reside an a DNS cache for 60 seconds before it is dropped and has to be requeried from the authoritative server, in this case ns1.dyndns.org through ns5.dyndns.org.
Say my TTL was set to what the default is on the zone (86400 seconds, or 1 day), to see what my local DNS server thinks voidmain.is-a-geek.net is I would type "dig voidmain.is-a-geek.net" just like in the first example. If I wanted to see what the authoritative server actually has for voidmain.is-a-geek.net I would type "dig voidmain.is-a-geek.net @ns1.dyndns.org". If I wanted to check the MX record I would type "dig MX voidmain.is-a-geek.net". Of course Windows doesn't come with the "dig" command like most every other operating system so if you want to run it on Windows I believe there is a Windows version of it out there somewhere. Of course there are many other ways to trace DNS. I used to use the "nslookup" command but "dig" is a little easier.
If you are going to be hosting sites it would benefit you to learn how to trouble-shoot DNS issues. I prefer to run my own servers so if something is broken it's going to be my own fault. The good part is, I have the power to correct the problem and don't have to wait on anyone else.