茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1671802 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
IMG_00028.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

小企鵝開談 : [轉貼]Nslookup: command not found error on CentOS 5

發表者 討論內容
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15771
[轉貼]Nslookup: command not found error on CentOS 5
Nslookup: command not found error on CentOS 5
Posted October 17th, 2007 in Linux/Unix/BSD

I've just started using a VPS (Virtual Private Server) with CentOS 5.0 i386 as the virtual server operating system, but it has a pretty minimal operating system install. When I went to run the nslookup command to look up an IP address I got the error message nslookup: command not found as shown in the example below.
$ nslookup www.google.com
bash: nslookup: command not found

So I obviously needed to install the package that contains the nslookup tool. Unfortunately doing yum search nslookup didn't produce any results. I know from using other Linux distros that nslookup is usually part of the bind tools library, so did a yum search bind and managed to find this package:
bind-utils.i386 30:9.3.3-9.0.1.el5 updates
Matched from:
bind-utils
Bind-utils contains a collection of utilities for querying DNS (Domain Name System) name servers to find out information about Internet hosts.
These tools will provide you with the IP addresses for given host names, as well as other information about registered domains and network addresses.

You should install bind-utils if you need to get information from DNS name servers.
http://www.isc.org/products/BIND/

Aha, this looked promising, so a quick yum install bind-utils should do the trick:
$ yum install bind-utils
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
base                      100% |=========================| 1.1 kB    00:00
updates                   100% |=========================|  951 B    00:00
centosplus                100% |=========================|  951 B    00:00
addons                    100% |=========================|  951 B    00:00
extras                    100% |=========================| 1.1 kB    00:00
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package bind-utils.i386 30:9.3.3-9.0.1.el5 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 bind-utils              i386       30:9.3.3-9.0.1.el5  updates           162 k

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 162 k
Is this ok [y/N]:

So now that bind-utils was installed, it was just a matter of running nslookup again to test and see if I actually had the tool I needed installed:
$ nslookup www.google.com
Server:         210.55.4.10
Address:        210.55.4.10#53

Non-authoritative answer:
www.google.com  canonical name = www.l.google.com.
Name:   www.l.google.com
Address: 74.125.19.104
Name:   www.l.google.com
Address: 74.125.19.147
Name:   www.l.google.com
Address: 74.125.19.99
Name:   www.l.google.com
Address: 74.125.19.103

That looks good!


原文出處:Nslookup: command not found error on CentOS 5
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15771
[轉貼]Linux 無法使用 nslookup 等指令
【系】Linux無法使用nslookup等指令

今天在練習DNS Server架設的時候, 發現我自己這台主機無法使用nslookup等指令:
# nslookup
bash: nslookup: command not found
# host
bash: host: command not found
# dig
bash: dig: command not found

這幾個指令都會出現無法使用的錯誤訊息, 基本上應該是bind-utils的套件沒有裝到, 可以用rpm -qa |grep bind來作查詢
# rpm -qa |grep bind
ypbind-1.19-9.fc7
bind-9.4.1-9.P1.fc7
bind-chroot-9.4.1-9.P1.fc7
rpcbind-0.1.4-6.fc7
bind-libs-9.4.1-9.P1.fc7

此時可以利用yum list是否有該套件可以安裝
# yum list bind-utils
Loading "installonlyn" plugin
updates 100% |=========================| 1.9 kB 00:00
Available Packages
bind-utils.i386 31:9.4.1-9.P1.fc7 updates

再利用yum install做安裝即可
# yum install bind-utils
Loading "installonlyn" plugin
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package bind-utils.i386 31:9.4.1-9.P1.fc7 set to be updated

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
bind-utils i386 31:9.4.1-9.P1.fc7 updates 173 k

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 173 k
Is this ok [y/N]: y
(這邊輸入y表示繼續安裝)
Downloading Packages:
(1/1): bind-utils-9.4.1-9 100% |=========================| 173 kB 00:02
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: bind-utils ######################### [1/1]

Installed: bind-utils.i386 31:9.4.1-9.P1.fc7
Complete!


恭喜啦, 就是這麼簡單就裝完了~



原文出處:【系】Linux無法使用nslookup等指令 @ 卡達+噗寶=阿噗噗 :: 隨意窩 Xuite日誌
前一個主題 | 下一個主題 | 頁首 | | |



Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|