Study of nslookup Command

 

Experiment

Study of nslookup Command

๐ŸŽฏ Aim

To query DNS servers and obtain domain name or IP address mapping using the nslookup command.


๐Ÿ“˜ Objective

By the end of this experiment, students will be able to:

  • Resolve domain names to IP addresses
  • Perform reverse DNS lookups
  • Query specific DNS servers
  • Understand DNS record types

๐Ÿ“– Theory

The nslookup (name server lookup) command is used to:

  • Query the Domain Name System (DNS)
  • Translate:
    • Domain name → IP address
    • IP address → Domain name

๐Ÿ‘‰ It helps in:

  • Troubleshooting DNS issues
  • Verifying DNS configuration
  • Checking domain resolution

๐Ÿ‘‰ It works in:

  • Non-interactive mode (single query)
  • Interactive mode (multiple queries)

๐Ÿงพ Syntax

nslookup [options] <domain_or_ip> [dns_server]

๐Ÿ”ง Common Usage

Non-Interactive Mode:

nslookup google.com

Reverse Lookup:

nslookup 8.8.8.8

๐Ÿงฐ Prerequisites

  • Linux system
  • Internet connectivity
  • DNS configured

๐Ÿ”ฌ Procedure & Commands

1️⃣ Lookup Domain Name

nslookup google.com

2️⃣ Reverse DNS Lookup

nslookup 8.8.8.8

3️⃣ Use Specific DNS Server

nslookup google.com 8.8.8.8

4️⃣ Enter Interactive Mode

nslookup

Then use:

> google.com > set type=mx > google.com

5️⃣ Query Specific Record Types

  • MX Record (Mail Server):
nslookup -type=mx google.com
  • NS Record (Name Server):
nslookup -type=ns google.com
  • A Record:
nslookup -type=a google.com

๐Ÿ–ฅ️ Sample Output

Server: 8.8.8.8 Address: 8.8.8.8#53 Name: google.com Address: 142.250.183.14

๐Ÿ” Output Interpretation

FieldMeaning
Server        DNS server used
Address        IP of DNS server
Name        Domain name
Address (result)        Resolved IP

๐Ÿ“ Exercises for Students

  1. Resolve a domain name to IP address.
  2. Perform reverse lookup of an IP.
  3. Query MX records of a domain.
  4. Use different DNS servers and compare results.
  5. Explore interactive mode and run multiple queries.

❓ Viva Questions

  • What is DNS?
  • What is nslookup used for?
  • Difference between forward and reverse lookup?
  • What is an MX record?
  • Why use different DNS servers?

⚠️ Precautions

  • Results may vary depending on DNS server
  • Some domains may restrict certain records
  • Ensure correct syntax in interactive mode

✅ Result

The nslookup command is an essential tool for DNS querying and troubleshooting, helping users understand domain resolution and network configuration.

Comments

Popular posts from this blog

Networks Lab PCCSL507 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Analysis of HTTP Protocol using Wireshark

Study and Use of ifconfig Command