Usage

ndig [options] <domain>

Options

Option Description
-t, --type [type...] Record type(s) to query
-s, --short [type...] Record type(s), short output (value only)
-n, --nameserver [ns] Nameserver to query (default: authoritative via SOA)
-v, --verbose Verbose output
-u, --unsorted Disable sorted output
-V, --version Print version
-h, --help Show help

Supported Types

Standard: A AAAA CNAME MX NS PTR SOA SRV TXT

DNSSEC: RRSIG DNSKEY DS NSEC NSEC3 CDNSKEY CDS

Shorthands: ALL (all standard types), DNSSEC (all DNSSEC types)


Nameserver Aliases

cloudflare · google · opendns · quad9 · verisign · comodo

Or pass any IP address or hostname directly.


Examples

# All records for a domain (queries authoritative NS automatically)
ndig example.com

# A records only
ndig -t A example.com

# MX records, values only
ndig -s MX example.com

# Multiple types
ndig -t A AAAA MX example.com

# Query via Google's public DNS instead of authoritative
ndig -n google -t A example.com

# All DNSSEC records
ndig -t DNSSEC example.com

# Short output for scripting
ndig -s A example.com