How to Fix nslookup, host, dig: -bash: command not found in Linux?

Related Articles


When i try to verify the dns and run a few dns command utilities such as host, dig and nslookup, below error appeared:

    [root@mail ~]# host -t mx zimbra.local
    bash: host: command not found
    [root@mail ~]# dig -t mx zimbra.local
    bash: dig: command not found
    [root@mail ~]# nslookup -t mx zimbra.local
    bash: nslookup: command not found

If you have above problems in your Linux server, probably you might be missing the package that contains bind utilities. Please note that the host, dig and nslookup are part of the bind utilities.


Run this command to install the bind utilities.

    [root@mail ~]# yum install bind-utils
    Setting up Install Process
    Setting up repositories
    Reading repository metadata in from local files
    Parsing package install arguments
    Resolving Dependencies
    --> Populating transaction set with selected packages. Please wait.
    ---> Downloading header for bind-utils to pack into transaction set.
    bind-utils-9.3.6-4.P1.el5_4.2.i386.rpm                                      |  43 kB     00:00
    ---> Package bind-utils.i386 30:9.3.6-4.P1.el5_4.2 set to be updated
    --> Running transaction check
    Dependencies Resolved
     Package                 Arch       Version          Repository        Size
     bind-utils              i386       30:9.3.6-4.P1.el5_4.2  rhellocalrepo     170 k
    Transaction Summary
    Install      1 Package(s)
    Update       0 Package(s)
    Remove       0 Package(s)
    Total download size: 170 k
    Is this ok [y/N]: y
    Downloading Packages:
    Running Transaction Test
    warning: bind-utils-9.3.6-4.P1.el5_4.2: Header V3 DSA signature: NOKEY, key ID 37017186
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing: bind-utils                   ######################### [1/1]
    Installed: bind-utils.i386 30:9.3.6-4.P1.el5_4.2
Sign up for the WP Engine affiliate program and receive a minimum of $150 per referral!

As always if you need any help you can reach us on twitter @ehowstuff or drop us a comment below. Jumping through archives page to read more articles..

Skytech is a part time blogger that has over 6 years experience in servicing, repairing and configuring computers and administering the server systems.

Related Articles

Powered by WordPress · Designed by Theme Junkie