• 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 not found

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}

If you encounter the below error while running the nslookup command:

nslookup: command not found

you may try installing the below package as per your choice of distribution:

OS Distribution Command
Debian apt-get install dnsutils
Ubuntu apt-get install dnsutils
Alpine apk add bind-tools
Arch Linux pacman -S bind-tools
Kali Linux apt-get install dnsutils
Fedora dnf install bind-utils
Raspbian apt-get install dnsutils

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. What is an equivalent of which on the Windows command line?
  2. ledctl: command not found
  3. bspc: command not found
  4. How to identify the HBA cards/ports and WWN in Linux
  5. df Command Examples in Linux
  6. printk and console log level
  7. asterisk: command not found
  8. quotacheck: command not found
  9. restorecon: command not found
  10. How to Integrate CentOS/RHEL system into an AD Domain with LDAP/Kerberos/SSSD

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright