

– 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 We do hope that you can now comfortably install the utilities when confronted with a system without them.Dig is a part of DNS utility package that often gets installed with BIND name servers. In this article, you learned how to install dig and nslookup command utilities in different Linux distributions and also the basic usage of the commands. To retrieve information about a domain name using the nslookup utility, use the following command. To check the MX record of the domain name run. To get more specific and display only the IP of the domain name append the +short argument as shown: # dig +short flags: qr rd ra QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1 >HEADER<<- opcode: QUERY, status: NOERROR, id: 58049 Sample Output > DiG 9.11.3-1ubuntu1.9-Ubuntu >

The command displays a host of information such as the version of the dig command utility, the DNS server, and its corresponding IP address. # dig -vĬheck dig Version in Arch Linux Using the dig commandĭig command can be used to query a domain name and retrieve information as shown: # dig To check the version of dig installed, run. # dig -vĬheck dig Version in Debian and Ubuntu Installing dig & nslookup on ArchLinuxįor ArchLinux, the command for installing dig and nslookup will be. # apt install dnsutilsĪgain, to verify the installation, run the command. On Debian and any of its derivatives including Debian, the installation is done using the apt command. # dig -vĬheck Dig Command Version Installing dig & nslookup on Debian / Ubuntu Upon successful installation, verify the version using the command below. On Red Hat Linux /CentOS, install dig and nslookup using the dnf command.
