Chris Asked: 2010-09-07 22:54:59 +0800 CST2010-09-07 22:54:59 +0800 CST 2010-09-07 22:54:59 +0800 CST On a linux server, how do you find out how long the DNS cache expiry time is? 772 On a linux server, how do you find out how long the DNS cache expiry time is? Thanks linux domain-name-system cache 1 Answers Voted Best Answer Yves Junqueira 2010-09-07T23:01:38+08:002010-09-07T23:01:38+08:00 Use dig to query for the hostname in question. $ dig +ttlid cetico.org ; <<>> DiG 9.6.0-APPLE-P2 <<>> +ttlid cetico.org ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47938 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;cetico.org. IN A ;; ANSWER SECTION: cetico.org. 3550 IN A 65.99.215.8 ;; Query time: 27 msec ;; SERVER: 192.168.1.1#53(192.168.1.1) ;; WHEN: Mon Sep 6 23:58:09 2010 ;; MSG SIZE rcvd: 44 In the case above, the TTL is 3550. In a normal DNS server, this is usually configured at the zone level, in the SOA line. That's where you specify the default TTL for the domain. But it can also be set for a hostname specifically, with a syntax similar to the output of dig above.
Use dig to query for the hostname in question.
In the case above, the TTL is 3550.
In a normal DNS server, this is usually configured at the zone level, in the SOA line. That's where you specify the default TTL for the domain. But it can also be set for a hostname specifically, with a syntax similar to the output of dig above.