How to install dig, nslookup, host commands in Linux

That can’t do moment we face when we are trying to check if the website is pointing to correct IP and the nameservers which are authoritative for our servers are added correctly at the registrar end. A newly installed machine will not have dig, nslookup, host commands. 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.

Installing is pretty straight process by the way.
My ubuntu sources list

root@crybit:~# cat /etc/apt/sources.list
deb lucid main
deb lucid-updates main
deb lucid-security main
deb lucid universe
deb lucid-updates universe

In ubuntu systems it is “dnsutils”

root@crybit:~# apt-get update
root@crybit:~# apt-get install dnsutils -y

In RHEL/Centos it will be bind-utils

root@crybit:~# yum install bind-utils

Arunlal Ashok

Linux Cloud Infrastructure / DevOps Engineer. I'm dealing Linux servers since 2012. I started this blog to share and discuss my ideas.

Always happy for an open discussion! Write to arun (@) crybit (dot) com. Check about me for more details. About this blog and our strong members, check The team

2 Responses

  1. Robert says:

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

Leave a Reply

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