Lurker News

Comments (122) 29 threads

Show all comments

Showing thread 14 of 29

mholt3 replies#
Love this, thank you!

Is there a way to query all DNS records? (I was surprised to learn that isn't the default.) This would be really helpful for troubleshooting people's Caddy questions (which are actually DNS problems).

andrewmcwatters1 reply#
You can't really query all DNS records these days anymore by using the ANY query type. The closest alternative is to run dig across all record types.

At Andrew McWatters & Co., we use a small internal utility called digany(1)[1][2] that does this for you.
[1]: https://github.com/andrewmcwattersandco/digany
[2]: https://github.com/andrewmcwattersandco/digany/blob/main/dig...

    andrewmcwatters@Andrews-MacBook-Pro digany % ./digany andrewmcwatters.com
    andrewmcwatters.com. 1799 IN A 107.172.29.10
    andrewmcwatters.com. 1800 IN NS dns1.registrar-servers.com.
    andrewmcwatters.com. 1800 IN NS dns2.registrar-servers.com.
    andrewmcwatters.com. 3601 IN SOA dns1.registrar-servers.com. hostmaster.registrar-servers.com. 1719805485 43200 3600 604800 3601
    andrewmcwatters.com. 1800 IN MX 20 eforward5.registrar-servers.com.
    andrewmcwatters.com. 1800 IN MX 15 eforward4.registrar-servers.com.
    andrewmcwatters.com. 1800 IN MX 10 eforward1.registrar-servers.com.
    andrewmcwatters.com. 1800 IN MX 10 eforward2.registrar-servers.com.
    andrewmcwatters.com. 1800 IN MX 10 eforward3.registrar-servers.com.
    andrewmcwatters.com. 1799 IN TXT "google-site-verification=39W1-Db36mrNNekPXww8TUdo7LcrmEUfv-gBmVTT1Dk"
    andrewmcwatters.com. 1799 IN TXT "v=spf1 include:spf.efwd.registrar-servers.com a:andrewmcwatters-17ce78.andrewmcwatters.com ~all"
    ...
bandie91#
or AXFR... but it is allowed on even less places than ANY.
mr-karan1 reply#
Would this be something close to what you're looking for?

  alias doggo-all='doggo $1 A AAAA AFSDB APL CAA CDNSKEY CDS CERT CNAME CSYNC DHCID DLV DNAME DNSKEY DS EUI48 EUI64 HINFO HIP HTTPS IPSECKEY KEY KX LOC MX NAPTR NS NSEC NSEC3 NSEC3PARAM OPENPGPKEY RRSIG RP SIG SMIMEA SOA SRV SSHFP SVCB TLSA TSIG TXT URI ZONEMD ${2:+@$2}'

  doggo-all example.com @1.1.1.1
varenc2 replies#
When I run that:

   $ doggo google.com A AAAA AFSDB APL CAA CDNSKEY CDS CERT CNAME CSYNC DHCID DLV DNAME DNSKEY DS EUI48 EUI64 HINFO HIP HTTPS IPSECKEY KEY KX LOC MX NAPTR NS NSEC NSEC3 NSEC3PARAM OPENPGPKEY RRSIG RP SIG SMIMEA SOA SRV SSHFP SVCB TLSA TSIG TXT URI ZONEMD
It takes 5+ seconds to get a response.

Classic `dig` though takes 50ms.

mr-karan#
Hm it took around 2.9s on my system. Let me see if I can concurrently lookup records for different records and optimise this. Thanks for sharing.

  time doggo google.com A AAAA AFSDB APL CAA CDNSKEY CDS CERT CNAME CSYNC DHCID DLV
  0.02s user 0.02s system 1% cpu 2.981 total