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

Symptoms:

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
    

Findings:
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.

READ  How to Add Blog to Technorati to Increase Traffic

Solution:

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
    =============================================================================
    Installing:
     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
    Complete!
    
Leave a Reply

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

SiteGround.com

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.

TRY FREE

* up to 30 days money back guarantee