17.2.4. Using the dig Utility
The
dig
utility is a command-line tool that allows you to perform DNS lookups and debug a nameserver configuration. Its typical usage is as follows:
dig [@server] [option...] name type
dig [@server] [option...] name type
See Section 17.2.2.2, “Common Resource Records” for a list of common types.
17.2.4.1. Looking Up a Nameserver Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
To look up a nameserver for a particular domain, use the command in the following form:
dig name NS
dig name NS
In Example 17.17, “A sample nameserver lookup”, the
dig
utility is used to display nameservers for example.com
.
Example 17.17. A sample nameserver lookup
17.2.4.2. Looking Up an IP Address Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
To look up an IP address assigned to a particular domain, use the command in the following form:
dig name A
dig name A
In Example 17.18, “A sample IP address lookup”, the
dig
utility is used to display the IP address of example.com
.
Example 17.18. A sample IP address lookup
17.2.4.3. Looking Up a Hostname Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
To look up a host name for a particular IP address, use the command in the following form:
dig -x address
dig -x address
In Example 17.19, “A sample host name lookup”, the
dig
utility is used to display the host name assigned to 192.0.32.10
.
Example 17.19. A sample host name lookup