Linux Tutorials

CentOS 7 dig command not discovered – The way to set up dig on CentOS

SEOClerks

I deployed CentOS 7 Linux minimal deployed within the cloud. Nevertheless, I’m unable to seek out the dig command on my newly created CentOS 7 server. It says ‘-bash: dig: command not discovered‘ I attempted yum set up dig, nevertheless it failed. How do I set up dig command on CentOS 7 Linux utilizing the command line?

Introduction:
The dig command is primarily used to question DNS servers. It’s a useful gizmo for community troubleshooting. It’s standard because of its flexibility, easy to make use of, and crystal clear output over host command. This web page reveals the right way to set up dig command on a CentOS Linux 7 utilizing the bash shell. You could log in as root person to put in the next package deal.

CentOS 7 dig command not discovered

You could get the next error once you run dig command:
$ dig www.cyberciti.biz
$ dig +brief myip.opendns.com @resolver1.opendns.com
Attempt to find the dig with kind command:
$ kind -a dig
Show your PATH settings on Linux with assist of echo command:
$ echo “$PATH”
CentOS 7 dig command not found

Eliminating “-bash: dig: command not discovered”

BIND (Berkeley Web Identify Area) is an implementation of the DNS (Area Identify System) protocols. BIND features a DNS server (named), which resolves host names to IP addresses; a resolver library and instruments for verifying that the DNS server is working correctly. Nevertheless, bind shouldn’t be put in by default together with the dig command.

You could set up bind-utils package deal. It comprises a set of utilities (reminiscent of dig command and different) for querying DNS title servers to seek out out details about web hosts. These instruments will give you the IP addresses for given host names, in addition to different details about registered domains and community addresses.

The way to set up dig on CentoS 7

You could set up bind-utils if that you must get info from DNS title servers. Use the yum command:
$ sudo yum set up bind-utils
How to install dig on CentOS Linux 7 using yum command

How do I exploit dig command?

The syntax is:
dig Hostname
dig DomaiNameHere
dig @DNS-server-name Hostname
dig @DNS-server-name IPAddress
dig @DNS-server-name Hostname|IPAddress kind
For instance:
$ dig www.cyberciti.biz
$ dig @1.1.1.1 bash.cyberciti.biz
$ dig @1.1.1.1 MX cyberciti.biz
$ dig @1.1.1.1 AAAA cyberciti.biz
dig command installed on a CentOS Linux 7 and displaying dns output of a query dig command put in on a CentOS Linux 7 and displaying dns output of a question

A tip about discovering package deal names

Wish to discover out which package deal owned dig command on a CentOS Linux 6/7? Strive:
# yum whatprovides ‘*bin/dig’
Find out which package provides dig command on CentOS Linux
The above command signifies that /usr/bin/dig command offered by bind-utils package deal.

Conclusion

And there you could have it, dig command put in and dealing appropriately on a CentOS Linux 7. You need to use the identical command on a CentOS Linux 6.x to put in dig command.

Posted by: Vivek Gite

The writer is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a coach for the Linux working system/Unix shell scripting. Get the newest tutorials on SysAdmin, Linux/Unix and open supply matters through RSS/XML feed or weekly e-mail e-newsletter.

Source link

Related Articles

Back to top button