• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

nslookup Command Examples in Linux

by admin

A tool for gathering name resolution information and testing name resolution. It is available on most Linux distributions as well as Microsoft Windows. This command has a non-interactive mode, in which you can provide a domain name in a single command, and an interactive mode, in which you can issue the command by itself and then provide domain names on separate consecutive prompts.

Syntax

The syntax for non-interactive mode is:

# nslookup {domain name}

nslookup Command Examples

1. The usage of nslookup command to find the IP address of domain name is shown here::

# nslookup example.com

2. The usage of nslookup command to find the authoritative nameserver of a domain is shown here:

# nslookup -type=NS example.com 8.8.8.8

3. Query for a reverse lookup (PTR record) of an IP address:

# nslookup -type=PTR 54.240.162.118

4. Query for ANY available records using TCP protocol:

# nslookup -vc -type=ANY example.com

5. Query a given name server for the whole zone file (zone transfer) of the domain using TCP protocol:

# nslookup -vc -type=AXFR example.com name_server

6. Query for a mail server (MX record) of the domain, showing details of the transaction:

# nslookup -type=MX -debug example.com

7. Query a given name server on a specific port number for a TXT record of the domain:

# nslookup -port=port_number -type=TXT example.com name_server

8. 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 example.com

9. The nslookup command can be used to make an authoritative query of an MX record from the DNS server. We can specify the authoritative nameserver for the zone as an argument as shown here:

# nslookup -query=mx example.com ns1.example.com

Filed Under: Linux

Some more articles you might also be interested in …

  1. rtorrent Command Examples in Linux
  2. cf: Command-line tool to manage apps and services on Cloud Foundry
  3. readpe Command Examples in Linux
  4. cbonsai: Cbonsai is a beautifully random bonsai tree CLI generator
  5. getopt Command Examples in Linux
  6. How to Enable/Disable CPUs (Limiting CPU count) in CentOS / RHEL
  7. qtile Command Examples in Linux
  8. How to find docker storage device and its size (device mapper storage driver)
  9. base64 Command Examples (Encode or decode file or standard input to/from Base64, to standard output)
  10. printf Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Chezmoi: A multi-machine dotfile manager, written in Go
  • cheat: Create and view interactive cheat sheets on the command-line
  • chars: Display names and codes for various ASCII and Unicode characters and code points
  • chafa: Image printing in the terminal

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright