07-25-2011, 05:22 AM
kpmedia's Avatar
kpmedia kpmedia is offline
Site Staff | Web Hosting, Photo
Join Date: Feb 2004
Posts: 4,311
Thanked 374 Times in 341 Posts
dig is a great tool for looking up DNS (domain name server) issues on your web server, or between servers, via SSH (secure shell).
However, for whatever reason, it can be missing from your Linux installation. Or "command not found".

[root@server ~]# dig
-bash: dig: command not found
Some software makers such as Parallels, the author of Plesk and Virtuozzo, seem to consider it a form of "security" by having it come uninstalled. (In fact, on a Plesk Linux VPS, quite a few things are missing! Yum, for example, on a CentOS 5 VPS loaded by Parallels Plesk. If you get a warning that yum can't be found either, then you'll want to contact your host about enabling yum.)

Simply install dig with yum: yum install bind-utils in SSH.

[root@server ~]# yum install bind-utils
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: mirrors.supportex.net
 * base: mirror.yourwebhoster.eu
 * extras: mirror.yourwebhoster.eu
 * updates: mirror.yourwebhoster.eu
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package bind-utils.x86_64 30:9.3.6-16.P1.el5 set to be updated
--> Processing Dependency: bind-libs = 30:9.3.6-16.P1.el5 for package: bind-utils
--> Running transaction check
--> Processing Dependency: bind-libs = 30:9.3.6-4.P1.el5_4.2 for package: bind
---> Package bind-libs.x86_64 30:9.3.6-16.P1.el5 set to be updated
--> Running transaction check
--> Processing Dependency: bind = 30:9.3.6-4.P1.el5_4.2 for package: caching-nameserver
---> Package bind.x86_64 30:9.3.6-16.P1.el5 set to be updated
--> Running transaction check
---> Package caching-nameserver.x86_64 30:9.3.6-16.P1.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

 Package                 Arch        Version                    Repository
 bind-utils              x86_64      30:9.3.6-16.P1.el5         base      178 k
Updating for dependencies:
 bind                    x86_64      30:9.3.6-16.P1.el5         base      988 k
 bind-libs               x86_64      30:9.3.6-16.P1.el5         base      895 k
 caching-nameserver      x86_64      30:9.3.6-16.P1.el5         base       62 k

Transaction Summary
Install       1 Package(s)
Upgrade       3 Package(s)

Total download size: 2.1 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): caching-nameserver-9.3.6-16.P1.el5.x86_64.rpm     |  62 kB     00:00
(2/4): bind-utils-9.3.6-16.P1.el5.x86_64.rpm             | 178 kB     00:00
(3/4): bind-libs-9.3.6-16.P1.el5.x86_64.rpm              | 895 kB     00:00
(4/4): bind-9.3.6-16.P1.el5.x86_64.rpm                   | 988 kB     00:00
Total                                           3.4 MB/s | 2.1 MB     00:00
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
base/gpgkey                                              | 1.5 kB     00:00
Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) 
<centos-5-key@centos.org>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating       : bind-libs                                                1/7
  Updating       : bind                                                     2/7
warning: /etc/sysconfig/named created as /etc/sysconfig/named.rpmnew
  Installing     : bind-utils                                               3/7
  Updating       : caching-nameserver                                       4/7
  Cleanup        : bind-libs                                                5/7
  Cleanup        : bind                                                     6/7
  Cleanup        : caching-nameserver                                       7/7

  bind-utils.x86_64 30:9.3.6-16.P1.el5

Dependency Updated:
  bind.x86_64 30:9.3.6-16.P1.el5
  bind-libs.x86_64 30:9.3.6-16.P1.el5
  caching-nameserver.x86_64 30:9.3.6-16.P1.el5

And then you can dig away!

[root@server ~]# dig digitalfaq.com mx

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> digitalfaq.com mx
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 65025
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3

;digitalfaq.com.                        IN      MX

digitalfaq.com.         81      IN      MX      10 mail.digitalfaq.com.

digitalfaq.com.         58      IN      NS      ns43.eurovps.com.
digitalfaq.com.         58      IN      NS      ns17.eurovps.com.

mail.digitalfaq.com.    81      IN      A
ns17.eurovps.com.       7320    IN      A
ns43.eurovps.com.       2942    IN      A

;; Query time: 5 msec
;; WHEN: Mon Jul 25 13:15:02 2011
;; MSG SIZE  rcvd: 147
Works perfectly.
Returned the request for MX records for the domain, to help troubleshoot.

Server problems? Need a better VPS host? See our non-spammy List of top quality VPS hosting providers.
Servers always have problems. Having a good hosts helps prevent/avoid them!

- Did my advice help you? Then become a Premium Member and support this site.
- Please Like Us on Facebook | Follow Us on Twitter

- Need a good web host? Ask me for help! Get the shared, VPS, semi-dedicated, cloud, or reseller you need.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts

Similar Threads
Thread Thread Starter Forum Replies Last Post
Solved: Locate command not working in Linux SSH, "No such file or directory" kpmedia SSH for VPS/Dedicated (CLI) 1 07-25-2011 04:30 AM
How to install aptitude on Ubuntu 10.10 kpmedia SSH for VPS/Dedicated (CLI) 0 06-30-2011 01:26 AM
How install for Magento magento87 Web Design + Site Planning 1 08-13-2010 08:30 AM
ATI MMC 7.7 hack install guide admin Capture, Record, Transfer 0 02-15-2005 05:22 AM
MMC software install jrnyhead Capture, Record, Transfer 3 02-09-2004 01:23 PM

Thread Tools

All times are GMT -5. The time now is 07:50 PM