

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 Get VPS Hosting How to Use the Dig Command Get all the resources you need for your next project. 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 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.
