2

I'm looking for a tool to lookup a domain name through a DNS server and outputs the time it took to resolve. My requirement is that it should bypass the DNS cache.

Has anyone used such a tool?

NOTE: "dig" doesn't have any option to bypass the cache and therefore will not be useful in this case.

  • What cache are you referring to? dig doesn't keep a cache of its own... – EEAA Dec 3 '13 at 6:27
  • The local dns cache used by the machine running dig from. – Basil A Dec 3 '13 at 9:33
13

dig also doesn't use any cache, but queries your configured resolver directly. If that resolver caches, you can use dig's +trace option to not use the resolver, but query DNS directly, from the rootservers down:

dennis@lightning:~$ dig +trace serverfault.com A

; <<>> DiG 9.9.3-rpz2+rl.13214.22-P2-Ubuntu-1:9.9.3.dfsg.P2-4ubuntu1 <<>> +trace serverfault.com A
;; global options: +cmd
.           397719  IN  NS  j.root-servers.net.
<cut more records>
.           518093  IN  RRSIG   NS 8 0 518400 20131210000000 20131202230000 59085 . f0hHbyv9t6RjM+S7xhK0ZfE1QXHTwyM8T8CDlwAwk+HZxTen+t84c41O kOM1n2eceUdZKaZ3e6xXbkbqskqSIMxgGLs4yo1WCqXVsxcwitvnNfIH HIvUZ+FuuPavS3YZFLDh1yFABzUgdjUUhxYj0O8vGM3tyPmqxlz/5tOM bO8=
;; Received 857 bytes from 127.0.1.1#53(127.0.1.1) in 394 ms

com.            172800  IN  NS  m.gtld-servers.net.
<cut more records>
com.            86400   IN  DS  30909 8 2 E2D3C916F6DEEAC73294E8268FB5885044A833FC5459588F4A9184CF C41A5766
com.            86400   IN  RRSIG   DS 8 1 86400 20131210000000 20131202230000 59085 . HIEdgrZDVtt+RismerX3wUwnourQWV1IOZjU9WZ0OGgyWl/SrotZkRoP DkpL4mwQ8DrcLCutcUZQ9jild82LE099JKPSGqOhP0Jo1eElIz7adI83 pVCuWSbZVAr44tbCCG/cUJ4x2/U5EGXObZtwx8xsx92Es9+BYlGxof8h Uao=
;; Received 739 bytes from 198.41.0.4#53(a.root-servers.net) in 389 ms

serverfault.com.    172800  IN  NS  ns1.serverfault.com.
serverfault.com.    172800  IN  NS  ns2.serverfault.com.
CK0POJMG874LJREF7EFN8430QVIT8BSM.com. 86400 IN NSEC3 1 1 0 - CK0Q5NFFJS5FUB0F2DNA098SBN0O663V NS SOA RRSIG DNSKEY NSEC3PARAM
CK0POJMG874LJREF7EFN8430QVIT8BSM.com. 86400 IN RRSIG NSEC3 8 2 86400 20131208054132 20131201043132 22625 com. Zz/lcv0uETfq4C+HNgnwGv4OjC47xg68ynrm+LUSqU1KG3sGHPbLGN0z 42xckt5KmK/uFnTcBATcEDkz/tCGA1ZMDPdjC5oK25T2yekkMVunZEgm uWx4cZw5oYd5DjD46WaMq6gdNUGL1kIk1/WzferodB6XN2AafrXbu3Zr NrQ=
9927MV13364KIN8K2F46QC2KIS54GB78.com. 86400 IN NSEC3 1 1 0 - 992CS48MFUM4P9CUSBGKOON6Q03NL1FA NS DS RRSIG
9927MV13364KIN8K2F46QC2KIS54GB78.com. 86400 IN RRSIG NSEC3 8 2 86400 20131210053605 20131203042605 22625 com. vdWi92PKyDk6b0U9d2Q1zpBRHZRKLS63PuYbdGD4JIRNv6MGNxRq5GUa CGp4CbfWNm03UaVbyel9zu6O6KYNeLHOpKUWNjTKnNHJuNcNBQqkj4V0 5Tpz7TNBZnQRwRixrSGnZmG33qKXjVjRXDWjj0Um5wE3x7sGJ1FoU6vy 3dE=
;; Received 597 bytes from 192.42.93.30#53(g.gtld-servers.net) in 394 ms

serverfault.com.    300 IN  A   198.252.206.16
serverfault.com.    300 IN  NS  ns2.serverfault.com.
serverfault.com.    300 IN  NS  ns1.serverfault.com.
;; Received 128 bytes from 198.252.206.80#53(ns1.serverfault.com) in 100 ms
| improve this answer | |
  • +1 This is exactly the answer I was about to write. :) – EEAA Dec 3 '13 at 6:28
  • What is the "A" letter mean? – Basil A Dec 3 '13 at 6:59
  • 1
    The record type to query (A, MX, NS, etc.), see the manpage. – scai Dec 3 '13 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.