0

By default when DNS servers do not respond dig does not show any information about the queries being sent. I can use the +qr option to see each query being sent:

$ dig +qr archive.ubuntu.com

; <<>> DiG 9.16.1-Ubuntu <<>> +qr archive.ubuntu.com
;; global options: +cmd
;; Sending:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21059
;; flags: rd ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: ec2af2d60803b6a5
;; QUESTION SECTION:
;archive.ubuntu.com.            IN      A

;; QUERY SIZE: 59

Unfortunately I still do not see the information I need most - the IP address the query is being sent to and ideally the port number too. Is it possible to make dig to show this information?

I can see this information for failed TCP connections but I would really like to see it failed UDP queries too.

$ dig +tcp archive.ubuntu.com
;; Connection to 172.29.128.1#53(172.29.128.1) for archive.ubuntu.com failed: timed out.
  • The port number is always 53, and the IP address should be the same for UDP or TCP so why not leverage the one from TCP error message? I did not see any option or way to achieve what you want specifically with `dig`. – Patrick Mevzek Mar 16 '22 at 16:25

0 Answers0