0% found this document useful (0 votes)
31 views2 pages

How To Use Nslookup Commands On Linux (Cmdref - Net - Cheat Sheet and Example)

The document provides a comprehensive guide on using the nslookup command in Linux for DNS lookups, including various commands and options available. It includes examples of how to perform different types of lookups, such as mapping names to addresses and checking TTL to authoritative DNS servers. Additionally, it offers tips and related commands for further DNS management tasks.

Uploaded by

jordan4offsec
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views2 pages

How To Use Nslookup Commands On Linux (Cmdref - Net - Cheat Sheet and Example)

The document provides a comprehensive guide on using the nslookup command in Linux for DNS lookups, including various commands and options available. It includes examples of how to perform different types of lookups, such as mapping names to addresses and checking TTL to authoritative DNS servers. Additionally, it offers tips and related commands for further DNS management tasks.

Uploaded by

jordan4offsec
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

11/24/21, 1:14 AM How to use nslookup Commands on Linux [cmdref.

net - Cheat Sheet and Example]

How to use nslookup Commands on Linux


DNS lookup utility

Table of Contents

How to use nslookup Commands on Linux


Commands List
nslookup options
Examples
Tips
How to check TTL to the authoritative DNS server
Step1 check Name Server(Authoritative DNS server)
Step2 check TTL to Authoritative DNS server

Related Pages

dig - How to use dig command in Linux


How to use host command on Linux

Commands List
Operation Command Example
lookups – mapping names to addresses nslookup HOST nslookup google.com
Debug nslookup -debug google.com
nslookup -d google.com
Reverse lookups – mapping addresses to names nslookup IP_ADDRESS nslookup 192.168.0.10
lookups at DNS Server nslookup HOST SERVER nslookup google.com 8.8.8.8
lookups at DNS Server nslookup IP SERVER nslookup 74.125.235.101 8.8.8.8
lookup for an any record nslookup -type=any HOST nslookup -type=any google.com
lookup for an soa record nslookup -type=soa HOST nslookup -type=osa google.com
lookup for an ns record nslookup -type=ns HOST nslookup -type=ns google.com
lookup for an a record nslookup -type=a HOST nslookup -type=a google.com
lookup for an mx record nslookup -type=mx HOST nslookup -type=mx google.com
lookup for an txt record nslookup -type=txt HOST nslookup -type=txt google.com

nslookup options

# man nslookup
NAME
nslookup - query Internet name servers interactively

SYNOPSIS
nslookup [-option] [name | -] [server]

INTERACTIVE COMMANDS

host [server]
Look up information for host using the current default server or using server, if specified.

server domain
lserver domain
Change the default server to domain;
lserver uses the initial server to look up information about domain,
while server uses the current default server.

set keyword[=value]
This command is used to change state information that affects the lookups. Valid keywords are:

type=value
Change the type of the information query.

(Default = A; abbreviations = q, ty)


https://cmdref.net/os/linux/command/nslookup.html 1/2
11/24/21, 1:14 AM How to use nslookup Commands on Linux [cmdref.net - Cheat Sheet and Example]

Examples

C:\ > nslookup


> set type=mx
> server 8.8.8.8 <- DNS Server
> example.com

>set d2 <- detail debugmode more than 'set debug'

> help
> exit

Tips
How to check DNS Server. nslookup google.com |grep -i server

How to check TTL to the authoritative DNS server


Step1 check Name Server(Authoritative DNS server)

$ nslookup -q=ns google.com

Non-authoritative answer:
google.com nameserver = ns4.google.com.
google.com nameserver = ns3.google.com.
google.com nameserver = ns2.google.com.
google.com nameserver = ns1.google.com.

Step2 check TTL to Authoritative DNS server

A Recode(TTL 300)

$ nslookup -debug -q=a google.com ns1.google.com


ANSWERS:
-> google.com
internet address = 172.217.175.238
ttl = 300

MX Recode(TTL 600)

$ nslookup -debug -q=mx google.com ns1.google.com


ANSWERS:
-> google.com
mail exchanger = 10 aspmx.l.google.com.
ttl = 600
-> google.com
mail exchanger = 30 alt2.aspmx.l.google.com.
ttl = 600
-> google.com
mail exchanger = 50 alt4.aspmx.l.google.com.
ttl = 600
-> google.com
mail exchanger = 20 alt1.aspmx.l.google.com.
ttl = 600
-> google.com
mail exchanger = 40 alt3.aspmx.l.google.com.
ttl = 600

https://cmdref.net/os/linux/command/nslookup.html 2/2

You might also like