Thursday, July 26, 2007

interpreting dig output, getting the TTL for your domain

When you need to lookup more information about a domain name than just its IP address, dig is your friend. Specifically, I needed to lookup the time-to-live for my domain, techanswerguy.com.

In DNS, a domain name will be cached for a specified amount of time. This is the domain's time-to-live or TTL. Usually, TTLs for domain names are set between 5 minutes and twenty-four hours. In practice, you are being a good net citizen if you set the TTL of your domain for as long as possible. In this way, you reduce the load on upstream DNS servers by reducing the number of DNS refreshes made for your domain.

Executing dig for techanswerguy.com, I found a load of information:
[root@computer]$ dig www.techanswerguy.com

; <<>> DiG 9.2.2 <<>> www.techanswerguy.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41554

;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 7, ADDITIONAL: 7

;; QUESTION SECTION:
;www.techanswerguy.com. IN A

;; ANSWER SECTION:
www.techanswerguy.com. 7200 IN CNAME GHS.GOOGLE.com.
GHS.GOOGLE.com. 48322 IN CNAME ghs.l.GOOGLE.com.
ghs.l.GOOGLE.com. 300 IN A 64.233.179.121

;; Query time: 19 msec
;; SERVER: 63.40.12.3#53(63.40.12.3)
;; WHEN: Thu Jul 26 11:20:54 2007
;; MSG SIZE rcvd: 324

The time-to-live for my domain is listed in the first line of output under the ANSWER SECTION:
www.techanswerguy.com. 7200 IN CNAME GHS.GOOGLE.com.

The second column shows that the time-to-live for my domain is 7200 seconds, or 120 minutes (7200sec/60sec per min) or two hours (7200sec/60sec per min/60sec per hour).

Hooray!

Rather than reinvent the wheel, I will defer to Paul Heinlein's excellent discussion of Domain Information Groper, the dig command available here:
http://www.madboa.com/geek/dig/

Have a ball with DIG!

No comments:

Feel free to drop me a line or ask me a question.