Last updated: 5 April 2021

There are various tools you can use to check a domain’s DNS records. In this article I look at cPanel’s Track DNS feature, a couple of online tools as well as the more advanced dig utility.

Checking DNS via cPanel

If your hosting package comes with the cPanel control panel then you can get basic information via the Track DNS option.

cPanel's 'Track DNS' tool, which uses the dig utility to retrieve DNS records for a domain.
Image: checking the DNS for the domain catalyst2.com.

The above image shows a search for the domain catalyst2.com. The most important information is listed at the top: the domain’s A record points to 84.18.210.139 and there are two MX records.

The zone information section provides more detailed information. The information is the output of a dig command, which I will discuss shortly. First, though, let’s look at some other online tools.

Checking DNS online

G Suite Toolbox

To get information about DNS resource records you can use online tools such as the G Suite Toolbox. You can simply enter the domain you want to query and select the DNS record you are interested in. For instance, the NS tab gives you a domain’s name servers. You can view all DNS records for a domain by selecting the ANY tab.

Domain Diagnosis

Another useful website is domaindiagnosis.com. Apart from information about a domain’s DNS the website also gives you information about the domain registration, the server that is running the website and the SSL certificate for the domain.

Historical DNS records

There are also websites dedicated to keeping track of historical DNS records. This can be useful if you want to revert DNS records but can’t remember the old values. Unfortunately, many of these websites are no longer free to use.

Using dig

The online tools mentioned above probably give you all the information you need. However, if you are looking for a more advanced tool then you may want to try the dig utility. The utility is installed on OSX and many Linux distributions by default and can also be used on Windows.

To query a DNS record you can run a command like dig catalyst2.com A. This returns the A record for the domain catalyst2.com:

$ dig catalyst2.com A

; <> DiG 9.11.8-RedHat-9.11.8-1.fc30 <> catalyst2.com A
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28917
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1452
;; QUESTION SECTION:
;catalyst2.com.			IN	A

;; ANSWER SECTION:
catalyst2.com.		3600	IN	A	84.18.210.139

;; Query time: 19 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Mon Aug 12 22:02:56 BST 2019
;; MSG SIZE  rcvd: 58

As you can see, dig returns much more than just the A record! I won’t discuss all the details (you can read the manual). Instead, I will give you few pointers to get you going.

Dig options

There are quite a few options that change dig’s behaviour. One useful option is +short. This option limits the output to just the answer to question:

dig catalyst2.com A +short
84.18.210.139

Reverse lookups

Instead of finding the IP address for a domain name you can also do the reverse by adding the -x option. This can be a quick way to find the server name for an IP address:

dig -x 84.18.206.207 +short
strawberry.active-ns.com.

The above output shows that the IP address 84.18.206.207 points to our Strawberry server.

Querying specific name server

All the DNS queries we have seen so far follow the same logic: the tool looks up the name servers for the domain name and then asks the name servers for authoritative information about a specific DNS record. Usually that is exactly what you want, but sometimes you may want to check the DNS records for a domain in another DNS zone.

For instance, let’s say you are migrating example.net to our Strawberry server. You have moved the website and are ready to change the name servers to ns5.catalyst2.net and ns6.catalyst2.net. However, before you do so you quickly want to check if the MX records in the new DNS zone are correct. To do so you can first check the current MX records:

dig example.net MX +short
0 aspmx.l.google.com.
5 alt1.aspmx.l.google.com.
5 alt2.aspmx.l.google.com.
10 alt3.aspmx.l.google.com.
10 alt4.aspmx.l.google.com.

To check what MX records have been set up on the Strawberry server you can use the @ option to query the new name servers directly:

dig @ns5.catalyst2.net example.net MX +short
0 example.net.
100 backuk-dmx01.active-ns.com.

Oops! We better change the MX records on the new server to make sure that emails will still be routed to G Suite!