Host, Status Code and A Record with dnsx

Resolves a hosts file with dnsx against explicit resolvers, saves the raw JSON, and prints just the host, DNS status code and A records.

cat HOSTS-FILE | dnsx -retry 5 -r 1.1.1.1,8.8.8.8 -j -or -o outputs/dnsx-FILE-hosts_$(now).json | jq '{host, "status_code", a}' -c

now is a shell alias/function for a timestamp, as in the Nuclei chains. Replace it with $(date +%Y%m%d_%H%M%S) if you don’t have one. For a deduplicated ip,domain CSV instead, see Resolve Domains to CSV.