Installing dig on a CentOS server is pretty easy, using yum. Dig is part of the bind utils package, so you will want to install bind-utils.
Basically
1 |
[root@dev ~]# yum install bind-utils |
Installation will look something like the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
[root@dev ~]# yum install bind-utils Loaded plugins: fastestmirror, priorities, replace Loading mirror speeds from cached hostfile * base: centos.aol.in * epel: mirror.nus.edu.sg * extras: centos.aol.in * remi: remi.check-update.co.uk * remi-test: remi.check-update.co.uk * rpmforge: ftp.kddilabs.jp * rpmforge-extras: ftp.kddilabs.jp * updates: centos.aol.in * webtatic: us-east.repo.webtatic.com Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package bind-utils.x86_64 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.x86_64 --> Processing Dependency: liblwres.so.80()(64bit) for package: 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.x86_64 --> Processing Dependency: libisccfg.so.82()(64bit) for package: 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.x86_64 --> Processing Dependency: libisccc.so.80()(64bit) for package: 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.x86_64 --> Processing Dependency: libisc.so.83()(64bit) for package: 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.x86_64 --> Processing Dependency: libdns.so.81()(64bit) for package: 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.x86_64 --> Processing Dependency: libbind9.so.80()(64bit) for package: 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.x86_64 --> Running transaction check ---> Package bind-libs.x86_64 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 x86_64 32:9.8.2-0.23.rc1.el6_5.1 updates 182 k Installing for dependencies: bind-libs x86_64 32:9.8.2-0.23.rc1.el6_5.1 updates 879 k Transaction Summary ======================================================================================================================================================================== Install 2 Package(s) Total download size: 1.0 M Installed size: 2.6 M Is this ok [y/N]: y Downloading Packages: (1/2): bind-libs-9.8.2-0.23.rc1.el6_5.1.x86_64.rpm | 879 kB 00:04 (2/2): bind-utils-9.8.2-0.23.rc1.el6_5.1.x86_64.rpm | 182 kB 00:01 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Total 124 kB/s | 1.0 MB 00:08 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.x86_64 1/2 Installing : 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.x86_64 2/2 Verifying : 32:bind-libs-9.8.2-0.23.rc1.el6_5.1.x86_64 1/2 Verifying : 32:bind-utils-9.8.2-0.23.rc1.el6_5.1.x86_64 2/2 Installed: bind-utils.x86_64 32:9.8.2-0.23.rc1.el6_5.1 Dependency Installed: bind-libs.x86_64 32:9.8.2-0.23.rc1.el6_5.1 Complete! [root@dev ~]# |
And you’re now ready to use dig!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
[root@dev ~]# dig google.com NS ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> google.com NS ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25165 ;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 4 ;; QUESTION SECTION: ;google.com. IN NS ;; ANSWER SECTION: google.com. 161287 IN NS ns2.google.com. google.com. 161287 IN NS ns1.google.com. google.com. 161287 IN NS ns3.google.com. google.com. 161287 IN NS ns4.google.com. ;; ADDITIONAL SECTION: ns2.google.com. 74887 IN A 216.239.34.10 ns1.google.com. 74887 IN A 216.239.32.10 ns3.google.com. 74887 IN A 216.239.36.10 ns4.google.com. 74887 IN A 216.239.38.10 |
Leave a Reply