dig
NetworkFundamentals In real LinuxQuery DNS records
Name: dig = domain information groper
This command needs a real Linux system; you can practise it in real Linux mode.
Description
dig queries DNS servers and shows the answers in detail. It handles A, AAAA, MX, TXT, NS, CNAME and other records and can ask a specific server; the first choice for DNS troubleshooting.
Syntax
dig [@SERVER] NAME [TYPE]Common options
| TYPE | Record type: A, AAAA, MX, TXT, NS … |
| +short | Short answer only |
| +noall +answer | Only the answer section (tidier than the default, fuller than +short) |
| +trace | Follow the lookup step by step from the root servers |
| @8.8.8.8 | Ask a specific server |
| -x ADDRESS | Reverse lookup: the name of an address |
| -t TYPE | The record type (same as TYPE), e.g. -t MX |
| -p PORT | The DNS server’s port (53 by default) |