How To Look Up DNS on a Linux and Unix Systems

There are several ways to look up DNS information on a Linux and Unix system, including using the “nslookup” and “dig” commands.

  1. “nslookup” command: The “nslookup” command is a simple tool for looking up information about a domain name, such as its IP address. To use the “nslookup” command, open a terminal window and enter the following command:
nslookup <domain name>

Replace “<domain name>” with the name of the domain that you want to look up. For example, to look up the IP address for the domain “google.com”, use the following command:

nslookup google.com
  1. “dig” command: The “dig” command is a more advanced tool for looking up DNS information, and it can provide more detailed information than “nslookup”. To use the “dig” command, open a terminal window and enter the following command:
dig <domain name>

Replace “<domain name>” with the name of the domain that you want to look up. For example, to look up the IP address for the domain “google.com”, use the following command:

dig google.com

In addition to the IP address, you can also look up other information about a domain name, such as the mail server, name server, and more, by using the appropriate options with the “nslookup” or “dig” command. It is recommended to consult the man pages of these commands for more information.

Leave a Comment