SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
Batch Script for nslookup range of IP Address
i | P a g e
Contents
Overview.......................................................................................................................................................1
Applies To......................................................................................................................................................1
Pre-requisites................................................................................................................................................1
DNS Search - Create......................................................................................................................................1
DNS Lookup – Test ........................................................................................................................................2
Create Batch script........................................................................................................................................2
Resolved IP Addresses ..............................................................................................................................3
Unresolved IP Addresses...........................................................................................................................3
Batch Script for nslookup range of IP Address
1 | P a g e
Overview
The purpose of this document is to resolve DNS for a range of IP Address.
Applies To
Windows Operating systems.
Pre-requisites
Any system running Windows OS, tested on windows 2008, Windows 2008 R2, Windows 8.1
DNS Search - Create
First thing that we create the IP range in a text file, and it should be one IP per line; as shown below.
Batch Script for nslookup range of IP Address
2 | P a g e
DNS Lookup – Test
To validate the result of the script, we will do a sample test of actual IP Address that gets resolved.
Create Batch script
Create a batch script file “iprange.cmd” and copy, paste the below script and save the file.
for /f %i in (ipslist.txt) do @nslookup %i 1>>nslookup-results.txt 2>>nslookup-errors.txt
Batch Script for nslookup range of IP Address
3 | P a g e
Resolved IP Addresses
All the resolved hosts would be stored in nslookup-results.txt file.
Note: Only the resolved IP address will be populated with Name of the host and IP address of the host
“Name:” and “Address:”
Unresolved IP Addresses
All the unresolved hosts would be stored in nslookup-errors.txt file.

More Related Content

PDF
Quantum Key Distribution
PDF
사물인터넷 시대의 보안 이슈와 대책
PDF
OT-IT convergence and IoT: innovate at scale and mitigate cyber risks
PDF
Detection as Code, Automation, and Testing: The Key to Unlocking the Power of...
PPTX
Building Service Intelligence with Splunk IT Service Intelligence (ITSI)
PDF
Easy IP Addressing and Subnetting Manual for Starters
PPTX
802.11ac Migration - Airheads Local
PDF
Updates from the Center for Threat-Informed Defense
Quantum Key Distribution
사물인터넷 시대의 보안 이슈와 대책
OT-IT convergence and IoT: innovate at scale and mitigate cyber risks
Detection as Code, Automation, and Testing: The Key to Unlocking the Power of...
Building Service Intelligence with Splunk IT Service Intelligence (ITSI)
Easy IP Addressing and Subnetting Manual for Starters
802.11ac Migration - Airheads Local
Updates from the Center for Threat-Informed Defense

What's hot (20)

PDF
Penetration testing & Ethical Hacking
PDF
Network security & cryptography full notes
PDF
Civil Society, Pegasus, and Predator: What Sophisticated Spyware Means For Us...
PDF
Empower Your Security Practitioners with Elastic SIEM
PDF
Evaluating and Enhancing Security Maturity through MITRE ATT&CK Mapping
PPTX
KubeClarity - CNCF Webinar.pptx
PPTX
Access Management with Aruba ClearPass
PPTX
CCNA 1 Routing and Switching v5.0 Chapter 2
PPTX
A short history of video coding
PDF
1. Network Security Monitoring Rationale
PPTX
Adopting A Zero-Trust Model. Google Did It, Can You?
PDF
Networking Fundamental Course by Haris Chughtai
PDF
Messaging Standards and Systems - AMQP & RabbitMQ
PDF
Meraki SD-WAN.pdf
PPTX
Substitution Cipher
PDF
Mapping ATT&CK Techniques to ENGAGE Activities
PDF
Mikrotik load balansing
PDF
Network security chapter 1
PDF
Trust No One - Zero Trust on the Akamai Platform
Penetration testing & Ethical Hacking
Network security & cryptography full notes
Civil Society, Pegasus, and Predator: What Sophisticated Spyware Means For Us...
Empower Your Security Practitioners with Elastic SIEM
Evaluating and Enhancing Security Maturity through MITRE ATT&CK Mapping
KubeClarity - CNCF Webinar.pptx
Access Management with Aruba ClearPass
CCNA 1 Routing and Switching v5.0 Chapter 2
A short history of video coding
1. Network Security Monitoring Rationale
Adopting A Zero-Trust Model. Google Did It, Can You?
Networking Fundamental Course by Haris Chughtai
Messaging Standards and Systems - AMQP & RabbitMQ
Meraki SD-WAN.pdf
Substitution Cipher
Mapping ATT&CK Techniques to ENGAGE Activities
Mikrotik load balansing
Network security chapter 1
Trust No One - Zero Trust on the Akamai Platform
Ad

Viewers also liked (8)

PDF
How To Protect SSH Access with Fail2Ban on RHEL 7
PDF
How To Install and Configure Screen on CentOS 7
PDF
How To Check IE Enhanced Security Is Enabled Windows PowerShell
PDF
How To Disable IE Enhanced Security Windows PowerShell
PDF
How To Install and Configure Salt Master on Ubuntu
PDF
Nginx bind() to 0.0.0.0:9080 failed
PDF
How To Configure Nginx Load Balancer on CentOS 7
PDF
How To Configure SNMP Logging on RHEL 7
How To Protect SSH Access with Fail2Ban on RHEL 7
How To Install and Configure Screen on CentOS 7
How To Check IE Enhanced Security Is Enabled Windows PowerShell
How To Disable IE Enhanced Security Windows PowerShell
How To Install and Configure Salt Master on Ubuntu
Nginx bind() to 0.0.0.0:9080 failed
How To Configure Nginx Load Balancer on CentOS 7
How To Configure SNMP Logging on RHEL 7
Ad

Similar to Batch script for nslookup range of ip address (20)

PPTX
PPTX
98 366 mva slides lesson 5
PPT
Linux Networking Commands
PPT
Networking session-4-final by aravind.R
PPTX
Network Mapping with PowerShell
DOC
Arp Dan Ipconfig Syntax
PDF
Boost your network troubleshooting skills with Top Usefeul IP Commands for wi...
PDF
Top IP Commands for Windows : Boost your network troubleshooting skills with ...
PDF
Explore Top IP Commands for Windows - InfosecTrain.pdf
PDF
𝐓𝐨𝐩 𝐈𝐏 𝐂𝐨𝐦𝐦𝐚𝐧𝐝𝐬 𝐟𝐨𝐫 𝐖𝐢𝐧𝐝𝐨𝐰𝐬
PDF
Top Useful IP Commands for Windows.pdf
PPTX
Commands.pptx
PDF
Using Windows Batch in command prompt. - Call this programCreate a.pdf
PPTX
Powershell Tech Ed2009
PDF
Footprinting LAB SETUP GUIDE.pdf
PPTX
Troubleshooting Network and Network Utilities
PPSX
Automating Windows Server 2008 R2 Administration with Windows PowerShell
PPTX
DNS,SMTP and POP3
PDF
amrapali builders @@ hacking with basic command.pdf
98 366 mva slides lesson 5
Linux Networking Commands
Networking session-4-final by aravind.R
Network Mapping with PowerShell
Arp Dan Ipconfig Syntax
Boost your network troubleshooting skills with Top Usefeul IP Commands for wi...
Top IP Commands for Windows : Boost your network troubleshooting skills with ...
Explore Top IP Commands for Windows - InfosecTrain.pdf
𝐓𝐨𝐩 𝐈𝐏 𝐂𝐨𝐦𝐦𝐚𝐧𝐝𝐬 𝐟𝐨𝐫 𝐖𝐢𝐧𝐝𝐨𝐰𝐬
Top Useful IP Commands for Windows.pdf
Commands.pptx
Using Windows Batch in command prompt. - Call this programCreate a.pdf
Powershell Tech Ed2009
Footprinting LAB SETUP GUIDE.pdf
Troubleshooting Network and Network Utilities
Automating Windows Server 2008 R2 Administration with Windows PowerShell
DNS,SMTP and POP3
amrapali builders @@ hacking with basic command.pdf

More from VCP Muthukrishna (20)

PDF
How to Fix Duplicate Packages in YUM on CentOS 7
PDF
How To Install and Configure GNome on CentOS 7
PDF
How To Connect to Active Directory User Validation
PDF
How To Connect To Active Directory PowerShell
PDF
How To List Files on Remote Server - PowerShell
PDF
How To List Files and Display In HTML Format
PDF
How To Check and Delete a File via PowerShell
PDF
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
PDF
How To Setup SSH Keys on CentOS 7
PDF
How To Install and Configure Open SSH Server on Ubuntu
PDF
Windows PowerShell Basics - How To List PSDrive Info
PDF
How To List Nginx Modules Installed / Complied on CentOS 7
PDF
Windows PowerShell Basics – How To Create powershell for loop
PDF
How To Construct IF and Else Conditional Statements
PDF
How To Create PowerShell Function Mandatory Parameter and Optional Parameter
PDF
How To Create Power Shell Function Mandatory Parameter Value
PDF
How To Create PowerShell Function
PDF
How To Find Package Installation Date on RHEL 7
PDF
How to Upgrade Openfire on CentOS 7
PDF
How To Reset root Password on CentOS 7
How to Fix Duplicate Packages in YUM on CentOS 7
How To Install and Configure GNome on CentOS 7
How To Connect to Active Directory User Validation
How To Connect To Active Directory PowerShell
How To List Files on Remote Server - PowerShell
How To List Files and Display In HTML Format
How To Check and Delete a File via PowerShell
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
How To Setup SSH Keys on CentOS 7
How To Install and Configure Open SSH Server on Ubuntu
Windows PowerShell Basics - How To List PSDrive Info
How To List Nginx Modules Installed / Complied on CentOS 7
Windows PowerShell Basics – How To Create powershell for loop
How To Construct IF and Else Conditional Statements
How To Create PowerShell Function Mandatory Parameter and Optional Parameter
How To Create Power Shell Function Mandatory Parameter Value
How To Create PowerShell Function
How To Find Package Installation Date on RHEL 7
How to Upgrade Openfire on CentOS 7
How To Reset root Password on CentOS 7

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Machine learning based COVID-19 study performance prediction
PDF
cuic standard and advanced reporting.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Empathic Computing: Creating Shared Understanding
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
KodekX | Application Modernization Development
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
MYSQL Presentation for SQL database connectivity
Machine learning based COVID-19 study performance prediction
cuic standard and advanced reporting.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Empathic Computing: Creating Shared Understanding
The AUB Centre for AI in Media Proposal.docx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
20250228 LYD VKU AI Blended-Learning.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Spectroscopy.pptx food analysis technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KodekX | Application Modernization Development
The Rise and Fall of 3GPP – Time for a Sabbatical?
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Reach Out and Touch Someone: Haptics and Empathic Computing
Building Integrated photovoltaic BIPV_UPV.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Weekly Chronicles - August'25 Week I

Batch script for nslookup range of ip address

  • 1. Batch Script for nslookup range of IP Address i | P a g e Contents Overview.......................................................................................................................................................1 Applies To......................................................................................................................................................1 Pre-requisites................................................................................................................................................1 DNS Search - Create......................................................................................................................................1 DNS Lookup – Test ........................................................................................................................................2 Create Batch script........................................................................................................................................2 Resolved IP Addresses ..............................................................................................................................3 Unresolved IP Addresses...........................................................................................................................3
  • 2. Batch Script for nslookup range of IP Address 1 | P a g e Overview The purpose of this document is to resolve DNS for a range of IP Address. Applies To Windows Operating systems. Pre-requisites Any system running Windows OS, tested on windows 2008, Windows 2008 R2, Windows 8.1 DNS Search - Create First thing that we create the IP range in a text file, and it should be one IP per line; as shown below.
  • 3. Batch Script for nslookup range of IP Address 2 | P a g e DNS Lookup – Test To validate the result of the script, we will do a sample test of actual IP Address that gets resolved. Create Batch script Create a batch script file “iprange.cmd” and copy, paste the below script and save the file. for /f %i in (ipslist.txt) do @nslookup %i 1>>nslookup-results.txt 2>>nslookup-errors.txt
  • 4. Batch Script for nslookup range of IP Address 3 | P a g e Resolved IP Addresses All the resolved hosts would be stored in nslookup-results.txt file. Note: Only the resolved IP address will be populated with Name of the host and IP address of the host “Name:” and “Address:” Unresolved IP Addresses All the unresolved hosts would be stored in nslookup-errors.txt file.