dig

dig - DNS lookup utility


Display the IP address of a host:

dig www.google.com A

Display the hostname of an IP address:

dig 172.217.28.142

Display IPV6 DNS servers:

dig iana.org AAAA

Display the MX (mail exchanger) of a domain/host name:

dig google.com MX

Display the NS (name server) of a domain name:

dig google.com NS

Show the SOA (Start of Authority) records for DNS zone name:

dig google.com SOA

Display the short version of a query:

dig +short google.com NS

Display the route from host to DNS server:

dig +trace google.com