digはcentosには標準では入っていない。
# dig -bash: dig: コマンドが見つかりません
インストールしようとする。
digはパッケージ名ではないらしい。
# yum install dig Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.riken.jp * extras: ftp.riken.jp * updates: ftp.riken.jp Setting up Install Process No package dig available. Error: Nothing to do
こういった場合に、yum providesが便利だと知った。
[CentOS] digコマンドをインストールするの巻 - TrippyBoyの愉快な日々
# yum provides dig Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.riken.jp * extras: ftp.riken.jp * updates: ftp.riken.jp Warning: 3.0.x versions of yum would erroneously match against filenames. You can use "*/dig" and/or "*bin/dig" to get that behaviour No Matches found
*/digで検索しなおせとのことなので、再検索。
# yum provides */dig Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.riken.jp * extras: ftp.riken.jp * updates: ftp.riken.jp 32:bind-utils-9.8.2-0.30.rc1.el6.x86_64 : Utilities for querying DNS name servers Repo : base Matched from: Filename : /usr/bin/dig kernel-debug-devel-2.6.32-504.el6.x86_64 : Development package for building kernel modules to match the debug : kernel Repo : base Matched from: Filename : /usr/src/kernels/2.6.32-504.el6.x86_64.debug/arch/ia64/dig kernel-devel-2.6.32-504.el6.x86_64 : Development package for building kernel modules to match the kernel Repo : base Matched from: Filename : /usr/src/kernels/2.6.32-504.el6.x86_64/arch/ia64/dig
digが含まれているパッケージが出てきました。
bind-utilsをインストールすればよいっぽいです。
さらに詳細を表示。
# yum info bind-utils Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.riken.jp * extras: ftp.riken.jp * updates: ftp.riken.jp Available Packages Name : bind-utils Arch : x86_64 Epoch : 32 Version : 9.8.2 Release : 0.30.rc1.el6_6.3 Size : 185 k Repo : updates Summary : Utilities for querying DNS name servers URL : http://www.isc.org/products/BIND/ License : ISC Description : 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.
「 Utilities for querying DNS name servers」。間違いなさそうなので、インストール。
# yum install -y bind-utils
インストールされたファイルの表示。
# rpm -ql bind-utils /usr/bin/dig /usr/bin/host /usr/bin/nslookup /usr/bin/nsupdate /usr/share/man/man1/dig.1.gz /usr/share/man/man1/host.1.gz /usr/share/man/man1/nslookup.1.gz /usr/share/man/man1/nsupdate.1.gz