Difference between revisions of "Dig"

From LinuxIntro
Jump to: navigation, search
m (See also)
Line 23: Line 23:
  
 
The syntax of a dig call is
 
The syntax of a dig call is
  dig <html><acronym title="Specific DNS server">@dnsserver</acronym> <acronym title="For example linuxintro.org">domain</acronym> <acronym title="Can be ANY, A, MX, SIG, etc.. By default it is A.">type</acronym></html>
+
  dig <abbr title="Specific DNS server">@dnsserver</abbr> <abbr title="For example linuxintro.org">domain</abbr> <abbr title="Can be ANY, A, MX, SIG, etc.. By default it is A.">type</abbr>
 
for example
 
for example
 
  dig @192.168.0.1 bartholomeus
 
  dig @192.168.0.1 bartholomeus

Revision as of 08:50, 19 April 2014

The command dig allows you to query a name server for IP addresses like this:

# dig www.linuxintro.org

; <<>> DiG 9.7.3-P1 <<>> www.linuxintro.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 884
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.linuxintro.org.            IN      A 

;; ANSWER SECTION:
www.linuxintro.org.     14400   IN      A       92.51.132.237

;; Query time: 67 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Sat Jul  2 14:34:22 2011
;; MSG SIZE  rcvd: 52

In this example we see the IP address of www.linuxintro.org is 92.51.132.237.

The syntax of a dig call is

dig @dnsserver domain type

for example

dig @192.168.0.1 bartholomeus

See also