​How to check DNS records on Windows, Linux and macOS?

Being an online business owner or a network administrator, checking DNS records will become a constant task for you. So better to know how to do it from now!

How to check DNS records on Windows, Linux and macOS? 

To check DNS records on Windows, Linux, and macOS, you can use the nslookup command. This command allows you to query DNS servers for information about a specific domain or hostname. Linux and macOS have another choice to check DNS records which is the host command. Both “nslookup” and “host” work well, but the second provides more detailed statistics and more options for precise searches. We do recommend using the host command!

Here you have how to use the “nslookup” command on Windows:

Open the Command Prompt.

Type “nslookup”, then put the option you need and the target (host or IP address).

Check what you need. Here you have some examples:

Check the IP address (A or AAAA record) of a specific domain (yours or another).

Type the domain or hostname, after the nslookup, that you want to look up, and press Enter.

Like this: nslookup domainexample.com

As a result, you will obtain, address: 126.110.1.17

Now, let’s check the NS (nameserver) record.

Type nslookup -type=ns domainexample.com

You will obtain the authoritative nameserver for this domain: domainexample.com nameserver = ns1.host.net

Let’s check one more, the MX records. Through this checking, you can supervise your mail servers’ functioning.

Type nslookup -query=mx domainexample.com

The result you will get:

domainexample.com MX preference = 0, mail exchanger = domainexample.com

Now, let’s use the “host” command on Linux and macOS:

Open the Terminal.

Type “host”, and then put the option you need and the target (host or IP address).

Now, you are ready to check the DNS records you need. Again, let’s try some examples.

Check the IP address (A or AAAA record) of a domain. This is very common and constant checking.

Type “host”, then the domain or hostname that you want to look up, and press enter.

Like this: host domainexample.com

The result you will get: domainexample.com has address 126.110.1.17

Type host -t ns domainexample.com and press Enter.

The nameservers of the domain will be displayed for you like this:

domainexample.com name server ns1.domainexample.com.

domainexample.com name server ns3.domainexample.com.

domainexample.com name server ns2.domainexample.com.

One more example. Let’s find de CNAME (canonical name) record.

Type: host -t cname mail.domainexample.com

You will get the true name of an alias:

mail.domainexample.com is an alias for domainexamplemail.l.domainexample.com

Why do you need to check DNS records?

  • Security. Through these checks, you can detect unauthorized DNS records set up for your domain. Then you can take action to prevent attempts to use it for malicious purposes.
  • Domain maintenance. Updates, new implementations, regular monitoring with detection or diagnosis purposes, etc., will require DNS records’ checks.
  • Performance. DNS records can boost or affect the performance of your online business.
  • Troubleshooting. Different issues (hardware and software) or errors can be related to DNS records. Checking them helps you identify the cause to fix it.

Suggested article: Dig command: How to use it in Linux?

Conclusion

Now you know how to check DNS records on Windows, Linux, and macOS! Check them and keep your online business healthy.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>