What does dig do?

query DNS name servers (a DNS lookup tool).

▸ Explain your own dig command →

dig examples, explained

$ dig example.com

  • digquery DNS name servers (a DNS lookup tool)
  • example.coman argument passed to the command

$ dig -t MX example.com

  • digquery DNS name servers (a DNS lookup tool)
  • -tquery for this record type (A, AAAA, MX, TXT, NS…)
  • MXvalue for -t
  • example.coman argument passed to the command

dig flags & options

-4use IPv4 transport only
-6use IPv6 transport only
-xdo a reverse lookup on the given IP address
-tquery for this record type (A, AAAA, MX, TXT, NS…)
-pquery the server on this port instead of 53
-bsend the query from this source address

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.