Using nslookup command

This is a network administration tool for querying the DNS to obtain the domain name or IP address mapping or any other specific DNS record. It can be used in non-interactive mode as well as in interactive mode in CLI by a user.

Following are the examples to illustrate the usage of nslookup command:

  • The usage of nslookup command to find the IP address of domain name is shown here:
$ nslookup www.centos.org
  • The usage of nslookup command to find the authoritative nameserver of a domain is shown here:
$ nslookup -type=ns centos.org
  • The nslookup command can be used to make a non-authoritative query of an MX record from a DNS server specified in /etc/resolv.conf file is shown here:
$ nslookup -query=mx centos.org

Get CentOS Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.