เครือข่ายและ DNS

How to install dig, host and nslookup commands on your system

เมื่อต้องการรันคำสั่ง dig, host หรือ nslookup แต่เครื่อง linux ของคุณไม่มีคำสั่งดังกล่าวนี้ สาเหตุเกิดจากคุณได้ install แบบ minimum (สำหรับ CentOS 6, RHEL 6) หรือไม่เลือก package อะไรเลยตอนติดตั้ง ดังนั้นถ้าต้องการรันคำสั่ง dig, host หรือ nslookup จะต้อง install bind-util ก่อนโดยสามารถใช้คำสั่ง yum install ได้เลย หรือใช้คำสั่ง rpm ในการติดตั้ง ตามตัวอย่างด้านล่างนี้ ใช้คำสั่ง rpm สำหรับ CentOS 5 และ RHEL 5

[root@ezylinux ~]# rpm -ivh bind-utils-9.3.6-16.P1.el5.i386.rpm

และมี dependency packages ดังนี้

bind-libs-9.3.6-16.P1.el5.i386.rpm
glibc-2.5-58.i686.rpm
krb5-libs-1.6.1-55.el5.i386.rpm

สำหรับ CentOS 6 และ RHEL 6

[root@ezylinux ~]# rpm -ivh bind-utils-9.7.0-5.P2.el6.i686.rpm

มี dependency packages ดังนี้

libxml2-2.7.6-1.el6.i686.rpm
zlib-1.2.3-25.el6.i686.rpm
bind-libs-9.7.0-5.P2.el6.i686.rpm
libidn-1.18-2.el6.i686.rpm
krb5-libs-1.8.2-3.el6.i686.rpm
glibc-2.12-1.7.el6.i686.rpm
openssl-1.0.0-4.el6.i686.rpm

ใช้คำสั่ง yum install


[root@ezylinux ~]# yum install bind-util
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.yourconnect.com
 * extras: mirror.yourconnect.com
 * updates: mirror.yourconnect.com
Setting up Install Process
No package bind-util available.
Error: Nothing to do
[root@s1 ~]# yum install bind-utils
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.yourconnect.com
 * extras: mirror.yourconnect.com
 * updates: mirror.yourconnect.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package bind-utils.x86_64 32:9.7.0-5.P2.el6_0.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================
 Package        Arch           Version             Repository        Size
===========================================================================
Installing:
 bind-utils    x86_64    32:9.7.0-5.P2.el6_0.1       updates        174 k

Transaction Summary
===========================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 174 k
Installed size: 433 k
Is this ok [y/N]: y
Downloading Packages:
bind-utils-9.7.0-5.P2.el6_0.1.x86_64.rpm                | 174 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : 32:bind-utils-9.7.0-5.P2.el6_0.1.x86_64             1/1

Installed:
  bind-utils.x86_64 32:9.7.0-5.P2.el6_0.1

Complete!
EOF.← กลับไปอ่านบทความอื่น