Post

DNS Commandline Functions

If you live your life on the command line. And the idea of using a website cluttered with advertising simply to find out some basic domain name settings is not appealing to you. I think the commands listed here will help you very much.

NSlookup

To query the domain example.com, type:

nslookup example.com This will return all the domain information, such as

  • The IP address,
  • Name servers,
  • other related information.

Specific to see the Nameservers

You can use the nslookup command in the command line to check where a domain’s name servers are pointing. Here’s how you can do it:

1
nslookup -type=NS example.com

Dig

The dig command is a powerful tool used to query DNS servers for information about a domain name. It can be used to find out the IP address of a domain, the mail server associated with a domain, and other information.

To use the dig command, open a command line window and type in the following command:

dig example.com

You can also use the dig command to query specific types of information. For example, to query the mail server associated with a domain, type in the following command:

1
2
3
dig example.com MX
dig example.com A
dig example.com NS

This will return the mail server associated with the domain.

You can also use the dig command to query other types of information, such as the nameservers associated with a domain. For more information, type in the following command:

1
dig -h

Host

The DNS host command is used to look up the IP address associated with a domain name. To use the DNS host command on the command line, open a terminal window and type the following command:

1
host https://example.com

Replace example.com with the domain name you want to look up.

The command will return the IP address associated with the domain name.

Whois

The whois command is used to look up information about a domain name or IP address.

To use the whois command, open a command line interface (CLI) such as the Windows Command Prompt or the Mac OS X Terminal.

At the prompt, type the command whois followed by the domain name or IP address you want to look up.

For example, to look up information about the domain name example.com, type the following command:

1
whois example.com

Find out who the DNS registrar is.

The who is command is also good to find out who the DNS register is. This will provide the name of the registrar and the person who registered the domain name.

1
whois example.com
This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.