dig コマンドを利用する

   
にほんブログ村 IT技術ブログ Linuxへ
にほんブログ村
環境
CentOS release 6.5
64bit

dig コマンドのパッケージを検索

yum list | grep bind

※「bind-utils」が対象パッケージです。

bind-utilsパッケージをインストール

yum install bind-utils.i686
 [root@kensyousever ~]# yum install bind-utils.i686
Loaded plugins: downloadonly, fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: ftp.jaist.ac.jp
 * extras: ftp.jaist.ac.jp
 * rpmforge: ftp.kddilabs.jp
 * updates: ftp.jaist.ac.jp
Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
The program yum-complete-transaction is found in the yum-utils package.
--> Running transaction check
---> Package bind-utils.i686 32:9.8.2-0.23.rc1.el6_5.1 will be installed
--> Processing Dependency: bind-libs = 32:9.8.2-0.23.rc1.el6_5.1 for package: 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.i686
--> Processing Dependency: liblwres.so.80 for package: 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.i686
--> Processing Dependency: libisccfg.so.82 for package: 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.i686
--> Processing Dependency: libisccc.so.80 for package: 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.i686
--> Processing Dependency: libisc.so.83 for package: 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.i686
--> Processing Dependency: libdns.so.81 for package: 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.i686
--> Processing Dependency: libbind9.so.80 for package: 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.i686
--> Running transaction check
---> Package bind-libs.i686 32:9.8.2-0.23.rc1.el6_5.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================================================================================================================
 Package                                        Arch                                     Version                                                        Repository                                   Size
==========================================================================================================================================================================================================
Installing:
 bind-utils                                     i686                                     32:9.8.2-0.23.rc1.el6_5.1                                      updates                                     181 k
Installing for dependencies:
 bind-libs                                      i686                                     32:9.8.2-0.23.rc1.el6_5.1                                      updates                                     891 k

Transaction Summary
==========================================================================================================================================================================================================
Install       2 Package(s)

Total download size: 1.0 M
Installed size: 2.7 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): bind-libs-9.8.2-0.23.rc1.el6_5.1.i686.rpm                                                                                                                                   | 891 kB     00:00
(2/2): bind-utils-9.8.2-0.23.rc1.el6_5.1.i686.rpm                                                                                                                                  | 181 kB     00:00
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                     1.5 MB/s | 1.0 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 32:bind-libs-9.8.2-0.23.rc1.el6_5.1.i686                                                                                                                                               1/2
  Installing : 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.i686                                                                                                                                              2/2
  Verifying  : 32:bind-libs-9.8.2-0.23.rc1.el6_5.1.i686                                                                                                                                               1/2
  Verifying  : 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.i686                                                                                                                                              2/2

Installed:
  bind-utils.i686 32:9.8.2-0.23.rc1.el6_5.1

Dependency Installed:
  bind-libs.i686 32:9.8.2-0.23.rc1.el6_5.1

Complete!

↑のような表記になれば、インストール完了。

digコマンドの利用確認

[root@kensyousever ~]# dig yahoo.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> yahoo.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5438
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 5, ADDITIONAL: 5

;; QUESTION SECTION:
;yahoo.com.                     IN      A

;; ANSWER SECTION:
yahoo.com.              1800    IN      A       98.139.183.24
yahoo.com.              1800    IN      A       206.190.36.45
yahoo.com.              1800    IN      A       98.138.253.109

;; AUTHORITY SECTION:
yahoo.com.              171855  IN      NS      ns5.yahoo.com.
yahoo.com.              171855  IN      NS      ns4.yahoo.com.
yahoo.com.              171855  IN      NS      ns3.yahoo.com.
yahoo.com.              171855  IN      NS      ns2.yahoo.com.
yahoo.com.              171855  IN      NS      ns1.yahoo.com.

;; ADDITIONAL SECTION:
ns1.yahoo.com.          171855  IN      A       68.180.131.16
ns5.yahoo.com.          171855  IN      A       119.160.247.124
ns2.yahoo.com.          171855  IN      A       68.142.255.16
ns3.yahoo.com.          171855  IN      A       203.84.221.53
ns4.yahoo.com.          171855  IN      A       98.138.11.157

;; Query time: 67 msec
;; SERVER: 192.168.11.12#53(192.168.11.12)
;; WHEN: Sat Jun  7 11:02:58 2014
;; MSG SIZE  rcvd: 245

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS