Nmap Command Reference Guide
Network Discovery & Target Specification Basics
What is Nmap?
Nmap (Network Mapper) is an open-source security tool used for network discovery, host inventory, and service
auditing. System administrators and security engineers use Nmap to identify live hosts, open ports, running
services, and network topology.
Core Target Specification Commands
1. Scan a Single Target (IP or Domain)
Scans a single target using Nmap's standard default scan settings (top 1,000 common ports).
Scan an IP address:
nmap [Link]
Scan a domain name:
nmap [Link]
2. Scan Multiple Targets
Specify multiple individual IP addresses or hostnames in a single command separated by spaces.
nmap [Link] [Link] [Link]
3. Scan Targets from a File ( -iL )
Read target list from a plain text file containing one IP or domain per line using the Input List flag.
nmap -iL [Link]
Example file content format ([Link]):
[Link]
[Link]
[Link]
4. Scan Subnets Using CIDR Notation
Scan an entire local network block or subnet by defining the network range with CIDR prefix notation (e.g., /24 for
256 IPs).
nmap [Link]/24
Nmap Fundamentals & Command Reference Page 1 of 2
5. Exclude Hosts from Range Scan ( --exclude )
Omit specific sensitive hosts or critical infrastructure devices (like gateways or domain controllers) from a range scan.
Exclude a single IP:
nmap [Link]/24 --exclude [Link]
Exclude multiple IPs:
nmap [Link]/24 --exclude [Link],[Link]
Quick Syntax Cheat Sheet
Target Type Command Syntax Description
Scans standard 1,000 ports on
Single IP nmap [Link]
single host
Resolves domain to IP and scans
Domain Name nmap [Link]
host
Scans specified space-separated
Multiple IPs nmap [Link] [Link]
targets
Input File nmap -iL [Link] Scans all targets listed inside file
Subnet (CIDR) nmap [Link]/24 Scans entire /24 network subnet
Skips specific host IP from
Excluded Hosts nmap [Link]/24 --exclude [Link]
network range
Nmap Fundamentals & Command Reference Page 2 of 2