To query all the available DNS record types associated with a domain use the ANY option. The following dig command sends the DNS query to Google’s name server(8.8.8.8) by using the option. You can change this default behavior by using the symbol followed by a hostname or IP address of the name server along. dig +noall +answer Specifying Nameserversīy default, dig commands will query the name servers listed in /etc/nf to perform a DNS lookup for you. Therefore, For a detailed information on answers section, you can stop displaying all the section using +noall option and query the answers section only by using +answer option with the dig command. Sometimes you want to view the answers section in details. You can do that by using the +short option, that will display the IP address (A record) of the domain name only: dig +short Detailed Answers The above dig command includes a lot of useful information in different sections, but there may be times when you want only the result of the query. The output will also contain other information like the installed dig version, technical details about the answers, statistics about the query, a question section along with few other ones. To perform a DNS lookup for a domain name, just pass the name along with the dig command: dig īy default, the dig command will display the A record when no other options are specified. Lets get into the basic uses of the command: Dig a Domain Name By default dig performs a lookup for an A record if no type argument is specified. For example, it can be an A record, MX record, SOA record or any other types. – the name of the resource record that is to be looked up. It is optional and if you don’t provide a server argument then dig uses the name server listed in /etc/nf. If the server argument is the hostname then dig will resolve the hostname before proceeding with querying the name server. – the IP address or hostname of the name server to query. In its simplest form, the syntax of the dig utility will look like this: dig
Once installed, check the version, to make sure the setup was completed successfully: dig -v Dig Syntax
#HOW TO GET THE MAIL COMMAND IN LINUX INSTALL#
You can also install the utility package that contains dig separately by accessing your VPS through SSH and using the following commands in the command line:ĭebian and Ubuntu: apt-get install dnsutils Dig is a part of DNS utility package that often gets installed with BIND name servers.