natesales / q

A tiny command line DNS client with support for UDP, TCP, DoT, DoH, DoQ and ODoH.
GNU General Public License v3.0
1.76k stars 62 forks source link

Authority Section not in output #19

Closed uggyuggy closed 2 years ago

uggyuggy commented 2 years ago

Hi, Thank's for sharing q

Noticed the AUTHORITY SECTION is not into the output (checked options but can't find something related) Is it the expected design ? Or something that could be added ?


$ q -V
https://github.com/natesales/q version 0.5.8 (e84c6bbbfaa762f904ffbbd402f83630fa67589e 2022-04-18T20:59:46Z)
$
$ q ns org.
org. 24h0m0s NS a0.org.afilias-nst.info.
org. 24h0m0s NS d0.org.afilias-nst.org.
org. 24h0m0s NS b0.org.afilias-nst.org.
org. 24h0m0s NS a2.org.afilias-nst.info.
org. 24h0m0s NS c0.org.afilias-nst.info.
org. 24h0m0s NS b2.org.afilias-nst.org.
$
$ q ns eff.org @a0.org.afilias-nst.info.
$
$  dig  ns eff.org @a0.org.afilias-nst.info.
..
;; AUTHORITY SECTION:
eff.org.        86400   IN  NS  ns4.eff.org.
eff.org.        86400   IN  NS  ns1.eff.org.
eff.org.        86400   IN  NS  ns2.eff.org.
..
$
natesales commented 2 years ago

I've changed this behavior in v0.6.0 to be more configurable. You can now toggle on each section with +[no]question/answer/authority/additional. +[no]all toggles them all at once.

~ ▴ q NS org. +authority @k.root-servers.net
Authority:
org. 48h0m0s NS a0.org.afilias-nst.info.
org. 48h0m0s NS a2.org.afilias-nst.info.
org. 48h0m0s NS b0.org.afilias-nst.org.
org. 48h0m0s NS b2.org.afilias-nst.org.
org. 48h0m0s NS c0.org.afilias-nst.info.
org. 48h0m0s NS d0.org.afilias-nst.org.
~ ▴ q NS org. +authority @k.root-servers.net
Authority:
org. 48h0m0s NS a0.org.afilias-nst.info.
org. 48h0m0s NS a2.org.afilias-nst.info.
org. 48h0m0s NS b0.org.afilias-nst.org.
org. 48h0m0s NS b2.org.afilias-nst.org.
org. 48h0m0s NS c0.org.afilias-nst.info.
org. 48h0m0s NS d0.org.afilias-nst.org.
~ ▴ q NS org. +all @k.root-servers.net
Question:
org. NS
Authority:
org. 48h0m0s NS a0.org.afilias-nst.info.
org. 48h0m0s NS a2.org.afilias-nst.info.
org. 48h0m0s NS b0.org.afilias-nst.org.
org. 48h0m0s NS b2.org.afilias-nst.org.
org. 48h0m0s NS c0.org.afilias-nst.info.
org. 48h0m0s NS d0.org.afilias-nst.org.
Additional:
a0.org.afilias-nst.info. 48h0m0s AAAA 2001:500:e::1
a2.org.afilias-nst.info. 48h0m0s AAAA 2001:500:40::1
b0.org.afilias-nst.org. 48h0m0s AAAA 2001:500:c::1
b2.org.afilias-nst.org. 48h0m0s AAAA 2001:500:48::1
c0.org.afilias-nst.info. 48h0m0s AAAA 2001:500:b::1
d0.org.afilias-nst.org. 48h0m0s AAAA 2001:500:f::1
a0.org.afilias-nst.info. 48h0m0s A 199.19.56.1
a2.org.afilias-nst.info. 48h0m0s A 199.249.112.1
b0.org.afilias-nst.org. 48h0m0s A 199.19.54.1
b2.org.afilias-nst.org. 48h0m0s A 199.249.120.1
c0.org.afilias-nst.info. 48h0m0s A 199.19.53.1
d0.org.afilias-nst.org. 48h0m0s A 199.19.57.1

This works the same way for the raw output format (which is different than dig's default).

~ ▴ q NS org. @k.root-servers.net --format raw
;; opcode: QUERY, status: NOERROR, id: 0
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 6, ADDITIONAL: 12

~ ▴ q NS org. +authority @k.root-servers.net --format raw
;; opcode: QUERY, status: NOERROR, id: 0
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 6, ADDITIONAL: 12

;; AUTHORITY SECTION:
org.    172800  IN  NS  a0.org.afilias-nst.info.
org.    172800  IN  NS  a2.org.afilias-nst.info.
org.    172800  IN  NS  b0.org.afilias-nst.org.
org.    172800  IN  NS  b2.org.afilias-nst.org.
org.    172800  IN  NS  c0.org.afilias-nst.info.
org.    172800  IN  NS  d0.org.afilias-nst.org.