Windows
Linux
Networking
Windows Resolve-DnsName equivalent in Linux
Looks up DNS records such as A, AAAA, MX, TXT and NS entries.
Windows
→
Resolve-DnsName
Linux equivalents
dig example.com
dig example.com
dig example.com
Overview
What this command does
Looks up DNS records such as A, AAAA, MX, TXT and NS entries.
Migration tip:
dig provides detailed DNS diagnostics. Add +short when you only need the resolved value.Practical tasks
Common use cases
Query DNS records
Looks up DNS records such as A, AAAA, MX, TXT and NS entries.
dig example.com
Query the default record type
dig +short example.com A
Show only IPv4 addresses
dig example.com MX
Query mail-exchanger records
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
dig example.com
dig +short example.com A
dig example.com MX
Walkthrough
Examples with explanations
dig example.com # perform a DNS lookup
dig +short example.com A # show only IPv4 answers
dig example.com MX # query MX records
Reference
Common options and variations
| Command or option | Use |
|---|---|
dig example.com | Query the default record type |
dig +short example.com A | Show only IPv4 addresses |
dig example.com MX | Query mail-exchanger records |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | dig example.com |
Same command on this distribution. |
| Fedora | same command | dig example.com |
Same command on this distribution. |
| Arch | same command | dig example.com |
Same command on this distribution. |
Keep learning