mr-karan / doggo

:dog: Command-line DNS Client for Humans. Written in Golang
https://doggo.mrkaran.dev/
GNU General Public License v3.0
2.83k stars 100 forks source link

feat: add support for common query types #128

Closed mr-karan closed 2 months ago

mr-karan commented 2 months ago

Using --any it will query multiple common record types.

./bin/doggo.bin example.com --any
NAME            TYPE    CLASS   TTL     ADDRESS                                 NAMESERVER
example.com.    A       IN      1152s   93.184.215.14                           127.0.0.53:53
example.com.    AAAA    IN      1138s   2606:2800:21f:cb07:6820:80da:af6b:8b2c  127.0.0.53:53
example.com.    MX      IN      7196s   0 .                                     127.0.0.53:53
example.com.    NS      IN      7196s   b.iana-servers.net.                     127.0.0.53:53
example.com.    NS      IN      7196s   a.iana-servers.net.                     127.0.0.53:53
example.com.    SOA     IN      3596s   ns.icann.org.                           127.0.0.53:53
                                        noc.dns.icann.org. 2024041841
                                        7200 3600 1209600 3600
example.com.    TXT     IN      7197s   "wgyf8z8cgvm2qmxpnbnldrcltvk4xqfn"      127.0.0.53:53
example.com.    TXT     IN      7197s   "v=spf1 -all"                           127.0.0.53:53
mr-karan commented 2 months ago

Need to prioritize concurrent resolver lookup support though to improve performance.

mr-karan commented 2 months ago

Just pushed a concurrent version of lookups. Speed up is around 80% :rocket:

time doggo example.com A AAAA CNAME MX NS PTR SOA SRV TXT CAA @1.1.1.1
0.01s user 0.01s system 1% cpu 1.356 total

time ./bin/doggo.bin example.com A AAAA CNAME MX NS PTR SOA SRV TXT CAA @1.1.1.1 
0.00s user 0.01s system 4% cpu 0.297 total
ammmir commented 2 months ago

related, but different: there's an ANY (meta?) query type, which depends on server-side support and seems to be deprecated, but still widely deployed. for reference, see dig any x.com

mr-karan commented 2 months ago

That's still possible with doggo ANY x.com @8.8.8.8 . However, most large scale DNS servers are moving away from ANY so it's not a good idea to depend on this.