adig is a command-line tool that allows you to perform DNS lookups from the command line. It is similar to the dig command, but it is designed specifically for use with the Async DNS library.
To use adig, you simply enter the command followed by the domain name that you want to look up, along with any desired options. For example, to perform a basic DNS lookup for the domain example.com, you would enter the following command:
# adig example.com
By default, adig will perform a lookup for the A record of the domain, which maps the domain name to an IP address. However, you can specify other record types using the -t option. For example, to perform a lookup for the MX record, which specifies the mail exchange servers for a domain, you would use the following command:
# adig -t MX example.com
You can also specify the DNS server to use for the lookup using the -s option. For example, to use the DNS server at 8.8.8.8 for the lookup, you would use the following command:
# adig -s 8.8.8.8 example.com
There are many other options available for adig, which you can view by using the -h option to display the help information.
adig Command Examples
1. Display A (default) record from DNS for hostname(s):
# adig {{example.com}}
2. Display extra [d]ebugging output:
# adig -d {{example.com}}
3. Connect to [s]pecified DNS server:
# adig -s {{1.2.3.4}} {{example.com}}
4. Use specified TCP port to connect to DNS server:
# adig -T {{port}} {{example.com}}
5. Use specified UDP port to connect to DNS server:
# adig -U {{port}} {{example.com}}