$ dig example.org ANY

Published: 2021-03-07

UPDATE 2021-05-23: dig-any.sh has now learned the ability to load a config file, read below.

A bit of context first: DNS "ANY" queries are since long deprecated, so if you want to query all DNS records (A, AAAA, CNAME, MX, ...) for a domain you have to manually run a sequence of DNS queries.

The tools that excel at this task are host, nslookup and dig. I usually use the latter because it's complete and I have to learn only one syntax.

Inspired by this tool (a web application to query many DNS records at once), I wrote my own "dig ANY" script. I thought it was a simple enough task to do without pulling in a Go small backend, hosting on AWS, connecting to their Lambda service and a JavaScript VueJS (!) frontend with js+css assets served by a CDN.

When sixty lines of bash leveraging dig did the job.

Plus 3 additional features:

dig-any.sh can load an arbitrary list of CNAME and SRV records to check. Instead of hardcoding them into the script[1], they are in an external config file to be stored elsewhere. Syntax of the config file is INI, example:

[domain.org]
cname="www mail guest"
srv="srv1 srv2 srv3"

This will configure these CNAME: www.domain.org, mail.domain.org, guest.domain.org and these SRV: domain.org.srv1, domain.org.srv2, domain.org.srv3

Multiple domains can be configured.

  1. and possibly give hints to the occasionally bored and nosy NSA employee (ha-ha).