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

Feature request: generic RR/bytes format output #97

Open crabique opened 3 months ago

crabique commented 3 months ago

Hello, thank you for the great tool, this one looks very promising.

Seeing the vast amount of tunables supported, I thought it would make sense to propose the things I'm about to propose, to make it even more powerful.

In modern dig versions, there is a +unknownformat option that lets you see the raw (well, hex) bytes for any RR value, so that it is not parsed by the client. This is useful when debugging very low-level DNS response issues.

Also, I noticed that the tool does not accept the TYPE<N> notation for records, supporting only the named RRs, but this is useful for working with experimental RR types that are not standard. Would be very cool if the tool could accept TYPE* as the type argument, even if there is no explicit support for parsing the response structure.

E.g. here (of course HTTPS RR is now standard, but it used to not be one):

❯ dig -t TYPE65 cloudflare.com +unknownformat +short
\# 61 0001000001000602683302683200040008681084E5681085E5000600 20260647000000000000000000681084E52606470000000000000000 00681085E5

❯ q -t HTTPS cloudflare.com --short
1 . alpn="h3,h2" ipv4hint="104.16.132.229,104.16.133.229" ipv6hint="2606:4700::6810:84e5,2606:4700::6810:85e5"

Thanks!