DNS or Domain Name Service resolves hostnames to IP addresses. Most enterprises have a local DNS to resolve hostnames managed by them, and then a public Internet DNS resolves external hostnames.
Troubleshooting DNS is performed with the utilities, nslookup or dig. Both provide similar information; however, dig is more detailed. In this section, the usage of dig is explored.
Figure 48. dig dell.com
The dig command displays results in the following sections:
- Header: The Header provides the version of dig, options that the dig command used, and the flags that are displayed.
- Question Section: The Question Section displays the original input provided to the command. In the preceding example, dell.com was queried. The default is to query the DNS A record. Other options are available for querying MX and NS records.
- Answer Section: The Answer Section is the output received by dig from the DNS server queried.
- Authority Section: The Authority Section lists the available Name Servers of dell.com. They have the authority to respond to this query.
- Additional Section: The Additional Section resolves the hostnames from the Authority Section to IP addresses.
- Stats Section: The footer at the end of the query is referred to as the Stats Section. It displays the query time, when the query was run, the server that responded, and the message size.
The dig command supports an array of options. The most common options include a reverse look-up using dig –x [IP address] to find a host name. The other is to specify a DNS server to query using dig @[dns server] [hostname].
For the complete list of dig options, see the FreeBSD manual page.