Red Hat Training

A Red Hat training course is available for Red Hat Linux

17.2.4. Using the dig Utility

The dig utility is a command-line tool that allows you to perform DNS lookups and debug a nameserver configuration. Its typical usage is as follows:
dig [@server] [option...] name type
See Section, “Common Resource Records” for a list of common types. Looking Up a Nameserver

To look up a nameserver for a particular domain, use the command in the following form:
dig name NS
In Example 17.17, “A sample nameserver lookup”, the dig utility is used to display nameservers for

Example 17.17. A sample nameserver lookup

~]$ dig NS

; <<>> DiG 9.7.1-P2-RedHat-9.7.1-2.P2.fc13 <<>> NS
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57883
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;                   IN      NS

;; ANSWER SECTION:            99374   IN      NS            99374   IN      NS

;; Query time: 1 msec
;; WHEN: Wed Aug 18 18:04:06 2010
;; MSG SIZE  rcvd: 77