Domain Information Groper
From Wikipedia, the free encyclopedia
Domain Information Groper (abbreviated dig, or sometimes DiG) is a network tool, like nslookup, that queries DNS name servers. It can be used to simulate a DNS resolver or a name server. DiG can be used for network troubleshooting and for educational purposes.
Here's an example of using DiG:
$ dig ce.sharif.edu ; <<>> DiG 9.2.4 <<>> ce.sharif.edu ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23567 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1 ;; QUESTION SECTION: ;ce.sharif.edu. IN A ;; ANSWER SECTION: ce.sharif.edu. 864000 IN A 81.31.164.3 ;; AUTHORITY SECTION: ce.sharif.edu. 864000 IN NS netserver.ce.sharif.edu. ;; ADDITIONAL SECTION: netserver.ce.sharif.edu. 864000 IN A 81.31.164.2 ;; Query time: 1 msec ;; SERVER: 81.31.164.2#53(81.31.164.2) ;; WHEN: Wed Nov 1 17:02:16 2006 ;; MSG SIZE rcvd: 87
Another example, using an MX record:
$ dig MX yahoo.com ; <<>> DiG 9.3.2 <<>> MX yahoo.com ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50065 ;; flags: qr rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 7, ADDITIONAL: 7 ;; QUESTION SECTION: ;yahoo.com. IN MX ;; ANSWER SECTION: yahoo.com. 3290 IN MX 1 f.mx.mail.yahoo.com. yahoo.com. 3290 IN MX 1 g.mx.mail.yahoo.com. yahoo.com. 3290 IN MX 1 a.mx.mail.yahoo.com. yahoo.com. 3290 IN MX 1 b.mx.mail.yahoo.com. yahoo.com. 3290 IN MX 1 c.mx.mail.yahoo.com. yahoo.com. 3290 IN MX 1 d.mx.mail.yahoo.com. yahoo.com. 3290 IN MX 1 e.mx.mail.yahoo.com. ;; AUTHORITY SECTION: yahoo.com. 157925 IN NS ns2.yahoo.com. yahoo.com. 157925 IN NS ns3.yahoo.com. yahoo.com. 157925 IN NS ns4.yahoo.com. yahoo.com. 157925 IN NS ns5.yahoo.com. yahoo.com. 157925 IN NS ns8.yahoo.com. yahoo.com. 157925 IN NS ns9.yahoo.com. yahoo.com. 157925 IN NS ns1.yahoo.com. ;; ADDITIONAL SECTION: ns1.yahoo.com. 150856 IN A 66.218.71.63 ns2.yahoo.com. 47503 IN A 68.142.255.16 ns3.yahoo.com. 157925 IN A 217.12.4.104 ns4.yahoo.com. 47503 IN A 68.142.196.63 ns5.yahoo.com. 150856 IN A 216.109.116.17 ns8.yahoo.com. 53868 IN A 202.165.104.22 ns9.yahoo.com. 53868 IN A 202.160.176.146 ;; Query time: 4 msec ;; SERVER: 194.105.19.22#53(194.105.19.22) ;; WHEN: Wed May 9 20:10:48 2007 ;; MSG SIZE rcvd: 399
[edit] Types of records
- A record maps a host to an IPv4 address.
- AAAA record maps a host to an IPv6 address. (The use of four A's is because an IPv6 address is four times as long as an IPv4 address.)
- CNAME record maps a host to its canonical name.
- LOC record provides a geographical location for a host. Rarely used.
- MX record comes from a mail exchange, and indicates where mail for a specific domain should be delivered.
- NS record indicates the name server that handles DNS queries for a domain.
- PTR record (short for “pointer”) maps an IP address to a hostname.
- SOA record specifies the DNS server providing authoritative information about an Internet domain.
- SRV record advertises services available on a host. It is a generalization of the MX record, used for load balancing.
- TXT records are used to include arbitrary text to a DNS record.
[edit] References
Paul Albitz and Cricket Liu. DNS and BIND, 5th Edition. Nutshell Series. O'Reilly and Associates, Inc., 2006.