ssh — guest: ~ connected
guest@ludovic.toinel.com:~$ man dig

dig — DNS lookup with the full answer

SYNOPSIS

dig <name> [type] [+short] dig -x <address> [+short]

DESCRIPTION

Asks a public resolver for the records of a name and prints the answer in the style of dig: the response status (NOERROR, NXDOMAIN, SERVFAIL...), its flags, the question, then one line per record with its TTL, class and type. The authority section (typically the SOA record of the zone) is shown when the resolver returns one, as it does for a name that does not exist. The query time and the server close the report.

The type defaults to A. Recognised types: A, AAAA, MX, TXT, NS, CNAME, SOA, CAA, SRV and PTR. ANY is not answered by public resolvers any more, so it is replaced by one query for each of the common types (A, AAAA, CNAME, MX, NS, TXT, SOA, CAA), merged into a single answer.

The type may come before or after the name, in upper or lower case.

OPTIONS

+short print only the record data, one per line -x <address> reverse lookup: PTR record of an IPv4 or IPv6 address

HOW IT WORKS

Browsers cannot send DNS packets, so the lookup goes through DNS-over-HTTPS: an HTTPS request to Google Public DNS (dns.google), which resolves the name and answers in JSON. The result is what a public resolver sees, not your local or corporate one, and the query time includes the HTTPS round trip. The "ad" flag means the resolver validated the answer with DNSSEC.

NOTES

The TTL is the number of seconds resolvers may still cache the record. A request is abandoned after 8 seconds, or at once with Ctrl+C.

EXAMPLES

dig example.com dig example.com MX dig example.com TXT +short dig example.com ANY dig -x 8.8.8.8

SEE ALSO

nslookup, whois, ping, curl, httpstest