unix

How do I fix my command not found error on my Linux server?

If you run a command and get a “command not found” error, you can do 2 things; specify the full path to the file and check to see if the package is installed.

$ nslookup www.google.com
bash: nslookup: command not found

$ /usr/bin/nslookup
-bash: /usr/bin/nslookup: No such file or directory

This means it isn’t installed. If you’re using yum, you can use this command:

yum provides “*/nslookup”

or

yum provides /usr/bin/nslookup

Then yum install .

In this case, yum provides “*/nslookup” returns this:

30:bind-utils-9.3.6-4.P1.el5_5.3.i386 : Utilities for querying DNS name servers.
Repo : updates
Matched from:
Filename : /usr/bin/nslookup

So then you need to install it.

yum install bind-utils

# nslookup google.com
Server: 192.168.1.154
Address: 192.168.1.154#53

Non-authoritative answer:
Name: google.com
Address: 74.125.224.84
Name: google.com
Address: 74.125.224.80
Name: google.com
Address: 74.125.224.81
Name: google.com
Address: 74.125.224.82
Name: google.com
Address: 74.125.224.83

Click to comment

Leave a Reply

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

To Top