There are various tools via which you can check a domain’s DNS records. In this article we will look at checking DNS records via cPanel, a couple of online tools as well as the more advanced dig utility.
If your hosting package comes with the cPanel control panel then you can get basic information via the Track DNS option.
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 188.8.131.52 and there are two MX records.
The zone information section provides more detailed information. The information is the output of a dig command, which we will discuss shortly. First, though, let’s look at some other online tools.
To get information about other records then just the A and MX 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, if get the name servers for the domain catalyst2.com by selecting the NS tab. Or, you can view all DNS records for a domain by selecting the ANY tab.
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.
There are also website dedicated to keeping track of historical DNS records. This can be useful if your DNS records have changed and you want to revert the changes. We particularly like securitytrails.com.
The online tools we have looked at will 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 it can also be used on Windows.
To query a DNS record you can run a command like
dig catalyst2.com A. This would return 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 184.108.40.206 ;; Query time: 19 msec ;; SERVER: 220.127.116.11#53(18.104.22.168) ;; 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! We won’t discuss all the details (you can read the manual). Instead, we will give you few pointers to get you going with dig.
There are quite a few options that changes dig’s behaviour. One useful option is
+short. This option will limit the output to just the answer to question:
dig catalyst2.com A +short 22.214.171.124
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 126.96.36.199 +short strawberry.active-ns.com.
The above output shows that the IP address 188.8.131.52 points to our Strawberry 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 that you are migrating the domain example.net to our Strawberry server. You have moved the website and you are ready to update the domain’s name servers to switch the DNS to our ns5.catalyst2.net and ns6.catalyst2.net name servers. Before you do so, though, you just want to check that the MX records will still point to G Suite. 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!