How To Direct and Reverse Ip Look Up With Nslookup In Linux and Windows?

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/how-to-direct-and-reverse-ip-look-up-with-nslookup-in-linux-and-windows/
PINTEREST
PINTEREST
INSTAGRAM

nslookup is a network tool using to query DNS to obtain domain name or IP address. The full name of nslookup is “name server lookup” . Nslookup supports interactive and batch mode. Nslookup alternative is dig which uses underlying Operating System libraries.

Syntax

Syntax is like below.

  • name is the domain name we want to use
  • server is the DNS server we want to use where if not specified the system provided DNS server will be used.

Interactive Usage

Nslookup can be used in  two different modes. One is interactive mode. In order to use nslookup interactively just enter nslookup in the command line.

Open nslookup interactive shell
Open nslookup interactive shell

We will get a shell to enter related commands. Query some domain name.

Query DNS with Nslookup
Query DNS with Nslookup

We get IP address of the domain in interactive mode. To exist interactive mode use exit command like below.

Interactive Usage
Interactive Usage

Reverse Lookup

To get domain name of an IP address is similar to the normal domain name lookup we will just provide the IP address of the target host like below.

Reverse Lookup
Reverse Lookup

Set New DNS Server

By default system provided DNS server is used. This is generally first local cache and then modem configuration where this is set by ISP.  DNS server can be changed like below in interactive mode.

Set New DNS Server
Set New DNS Server

MX Lookup or Get Mail Server Domain Name

DNS provides information about domain names. Also mail, sip and other related information about domain can be get by specifying  type parameter.

LEARN MORE  How To Discover Network Hosts With Nmap?

In this example we will try to get mail server domain name

MX Lookup or Get Mail Server Domain Name
MX Lookup or Get Mail Server Domain Name

Get Soa Server Domain Name

Soa or DNS server information can be get with soa type queries.

Get Soa Server Domain Name
Get Soa Server Domain Name

We will get information about mail address first name server etc. from soa request.

Batch Mode

Batch mode is second mode. This mode usage is simple command line usage. Just provide command and related arguments. We do not need to enter specific nslookup shell.

Batch Mode
Batch Mode

Specify Record Type

As DNS system have a lot of different type of records we may need to specify a specific record type in batch mode. We will use -type option and related record type in order to list only specific record type. In this example we will list mx record type.

Specify Record Type
Specify Record Type

Query NS Record Of A Domain

The main use case for the nslookup is querying NS records. NS records provides information about DNS servers of the given domain name. In this example we will list DNS servers of the poftut.com .

Query NS Record Of A Domain 
Query NS Record Of A Domain

Query MX Record Of A Domain For Mail Server

MX record is used to list mail servers. We can only list MX records of the given domain with the mx type. In this example we will list mail servers of the poftut.com.

Query MX Record Of A Domain For Mail Server
Query MX Record Of A Domain For Mail Server

Query SOA Record Of A Domain

SOA or Start Of Authority records provides technical information about the given domain. We can query the domain with the soa type like below.

LEARN MORE  How To Release and Renew IP Address In Windows with Ip Release and Renew

Query SOA Record Of A Domain
Query SOA Record Of A Domain

List All Ns Records Of A Domain

Up to now we have listed DNS related information about domain name one by one. If we need to list all related information provided by a DNS server we can use any record type.

List All Ns Records Of A Domain
List All Ns Records Of A Domain

Use Different DNS Server

The default behavior of the nslookup command is using default system provided DNS server. In some cases we may need to change this default DNS server and specify one explicitly. We can add DNS server to the end of the command. In this example we will use 8.8.8.8 as DNS server. We can also specify DNS server domain name.

Use Different DNS Server
Use Different DNS Server

Specify Different Than Default Port

The default port for DNS services is 53 . If we know that DNS service we will use is using different port we can explicitly specify the port number with the -port option like below. In this example we will specify the port number 60

Debug Transaction

While getting related record types there is a lot of transaction and steps which is taken under the hood. If we need to list verbose information and want to know details about nslookup we can use -debug option for this.

Debug Transaction
Debug Transaction

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/how-to-direct-and-reverse-ip-look-up-with-nslookup-in-linux-and-windows/
PINTEREST
PINTEREST
INSTAGRAM