The dig
command is not installed by default on CentOS 8, but it can be easily installed using the package manager. Here are the steps to install dig
on CentOS 8:
- Update the package manager: Run the following command to update the package manager and ensure that it has the latest package information:
sudo dnf update
- Install the
bind-utils
package: Thedig
command is part of thebind-utils
package, which can be installed using the following command:
sudo dnf install bind-utils
- Verify the installation: Run the following command to verify that the
dig
command is installed and working properly:
dig
You should see the usage information for the dig
command.
- Start Using the dig command : You can now use the
dig
command to query DNS servers for information. For example, you can use the following command to query the DNS server for the IP address of the domaingoogle.com
:
dig google.com
Alternatively, you can also use the nslookup
command to query the DNS server.
Note : If you’re using firewall make sure to allow the port 53 to allow DNS query.