How to install dig, nslookup, host commands in Linux

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.

How to install dig, nslookup, host commands?
How to install dig, nslookup, host commands?

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

2, Advantages of Prometheus monitoring tool

, ,

Post navigation

Arunlal A

Senior System Developer at Zeta. Linux lover. Traveller. Let's connect! Whether you're a seasoned DevOps pro or just starting your journey, I'm always eager to engage with like-minded individuals. Follow my blog for regular updates, connect on social media, and let's embark on this DevOps adventure together! Happy coding and deploying!

4 thoughts on “How to install dig, nslookup, host commands in Linux

  1. Thanks! I’m using Ubuntu 16.04 and wanted to use the dig command. I used sudo and it installed just fine.

  2. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *