#dns
18 one-liners with this tag.
All one-liners tagged dns
Check a domain's DKIM key in DNS
$dig +short default._domainkey.example.com TXT
Check DNS propagation across public resolvers
$for ns in 1.1.1.1 8.8.8.8 9.9.9.9 208.67.222.222; do echo "$ns: $(dig +short @$ns example.com A | tr '\n' ' ')"; done
Check if a server IP is on the Spamhaus blacklist
$dig +short $(echo 203.0.113.10 | awk -F. '{print $4"."$3"."$2"."$1}').zen.spamhaus.org
Check the CAA record of a domain
$dig +short example.com CAA
Check whether DNSSEC works for a domain
$dig @1.1.1.1 +dnssec example.com SOA | grep -E "flags:|RRSIG|status:"
Compare the SOA serial on all nameservers
$for ns in $(dig +short example.com NS); do echo "$ns $(dig +short @$ns example.com SOA | awk '{print $3}')"; done
Look up the MX records of a domain
$dig +short example.com MX
Look up the reverse DNS (PTR) of an IP address
$dig +short -x 203.0.113.10
Query a DNS record directly at the authoritative nameserver
$dig @$(dig +short example.com NS | head -n 1) example.com A +norecurse +short
Query any DNS record with its TTL
$dig example.com A +noall +answer
Show a domain's DNS zone in Plesk
#plesk bin dns --info example.com
Show the authoritative nameservers of a domain
$dig +short example.com NS
Show the DMARC policy of a domain
$dig +short _dmarc.example.com TXT
Show the SPF record of a domain
$dig +short example.com TXT | grep -i "v=spf1"
Test a website on a new server before the DNS change
$curl -sSI --resolve example.com:443:203.0.113.10 https://example.com/
Trace DNS delegation from the root zone
$dig +trace example.com
Verify a real Googlebot via reverse DNS
$n=$(host 66.249.66.1 | awk '/pointer/ {print $NF}'); echo "PTR: $n"; host "$n"
Verify reverse DNS of a mail server IP (FCrDNS)
$ptr=$(dig +short -x 203.0.113.10 | head -n 1); echo "PTR: $ptr"; dig +short "$ptr" A