How to install dig, nslookup, host commands on Linux machine? How to install dig on RHEL 6, RHEL 7, CentOS 6 / CentOS 7 servers? How to install dig, nslookup, host commands on Debian servers? These commands are very important for Linux server administrators, especially the peoples who are working on web hosting field.
These commands are very much useful to lists the DNS zone details of a domain name. Identifying these things are very important in web hosting filed.
A newly installed machine may not have dig, nslookup, host commands by default. So we have to manually install them on our servers. All these commands are included in a package called “bind-utils“.
But different OS have different package names. I will be doing everything as root user, if you don’t have root privileges then you just have to add sudo before every command.
Installation is pretty straight forward process.
My ubuntu sources list
root@crybit:~# cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu lucid main
deb http://archive.ubuntu.com/ubuntu lucid-updates main
deb http://security.ubuntu.com/ubuntu lucid-security main
deb http://archive.ubuntu.com/ubuntu lucid universe
deb http://archive.ubuntu.com/ubuntu lucid-updates universe
How to install dig, nslookup, host commands in Debian based server?
In ubuntu systems it is “dnsutils”
root@crybit:~# apt-get update
root@crybit:~# apt-get install dnsutils -y
How to install dig, nslookup, host commands in rpm based machine using YUM?
- How to install it on CentOS 6, CentOS 7, RHEL 6, RHEL 7 etc ?
In RHEL/Centos it will be bind-utils
root@crybit:~# yum install bind-utils
The above commands are quit strait forward and simple to use.
Have a nice DNS lookup!! 🙂
Recommended articles:
1, Modern Monitoring Concepts – An Introduction To Prometheus World
Thanks! I’m using Ubuntu 16.04 and wanted to use the dig command. I used sudo and it installed just fine.
You’re welcome, Robert!
Great! I wonder why distro’s don’t use the same name for their utils. I have to switch between ubuntu and Centos about 50 times a day. it gets confusing.
thanks for info