Skip to main content

Dig

"Dig" is a tool on Unix and Linux servers that queries the Domain Name System for DNS records.

About the Dig tool

Computers use the Domain Name System (or DNS for short) to convert human-readable domain names (e.g. www.soliddevtools.com) into an IPv4 address (e.g. 109.228.50.239) or an IPv6 address (e.g. 2a00:da00:1800:15a::1).

DNS records also store information about the millions of domains and websites that are on the Internet - such as an approved list of servers that can send mail on your domain's behalf (known as SPF records.)

Use Cases

Use the Dig tool on Solid Tools for Developers to:

  • Find the IP address of a website
  • Check if a DNS record exists
  • Check if a change made in DNS has been published

Usage

Enter a DNS record you wish to query in the "Domain name/record" field - e.g. www.google.com.

If you wish to query a specific DNS server, enter it's hostname or IP address in the "DNS server" field. If you don't know what this is, leave it as localhost.

Select the type of record you would like to query. For example: to find the IP address of a domain name, use the query type A (IP address).

By default, Solid Tools for Developers will use its own DNS server to return your results. This may include cached data if the record was recently queried. To force the use of "live" data, tick the "Trace" option.

Results

The complete output from the "Dig" tool will be displayed.

The "flags" line at the top will include a line like QUERY: 1, ANSWER: 1, AUTHORITY: 4. The figure next to ANSWER will tell you how many results were found.

The results themselves will be displayed under the section labelled ;; ANSWER SECTION.

The following example shows a successful query to find the IPv4 address of www.google.com:

; <<>> DiG 9.10.3-P4-Ubuntu <<>> @localhost  www.google.com A
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25982
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 5

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.google.com.			IN	A

;; ANSWER SECTION:
www.google.com.		300	IN	A	216.58.213.100

;; AUTHORITY SECTION:
google.com.		172800	IN	NS	ns2.google.com.
google.com.		172800	IN	NS	ns3.google.com.
google.com.		172800	IN	NS	ns1.google.com.
google.com.		172800	IN	NS	ns4.google.com.

;; ADDITIONAL SECTION:
ns1.google.com.		172800	IN	A	216.239.32.10
ns2.google.com.		172800	IN	A	216.239.34.10
ns3.google.com.		172800	IN	A	216.239.36.10
ns4.google.com.		172800	IN	A	216.239.38.10

;; Query time: 109 msec
;; SERVER: ::1#53(::1)
;; WHEN: Wed Dec 06 11:48:51 GMT 2017
;; MSG SIZE  rcvd: 195