A powerful, feature-rich command-line tool for testing network connectivity to multiple hosts and ports with parallel processing, multiple output formats, and automatic dependency management.
- ✅ ICMP Ping Testing - Test connectivity with ping (accepts URLs and IPs)
- ✅ DNS Lookup - Resolve hostnames to IPs with multiple fallback methods (accepts URLs)
- ✅ TCP Port Testing - Check if ports are open and responsive
- ✅ HTTP Status Checking - Get HTTP/HTTPS response codes and performance metrics
- ✅ SSL Certificate Validation - Check certificate expiry and validity
- 🆕 Show Network Interfaces - Display all network interfaces with IPs (--my-ip)
- 🆕 Retry Logic - Automatically retry failed connections with configurable count and delay
- 🆕 HTTP Status Codes - Check website status with response time and size (-s/--status)
- 🆕 SSL Certificate Check - Validate SSL/TLS certificates with expiry warnings (--cert)
- ✅ Parallel Processing - Check multiple hosts simultaneously (up to 256 jobs)
- ✅ Quick Mode Parallel Processing - Automatic parallel execution for wide IP ranges (>5 tests)
- ✅ Quick Mode Output File - Save quick mode results with -o/--output flag
- ✅ Response Time Measurement - See connection latency in milliseconds
- ✅ Multiple Output Formats - Text, JSON, CSV, XML
- ✅ Quick Test Mode - Test single host without creating files
- ✅ IP Range Support - Check IP ranges (192.168.1.1-50) and CIDR (10.0.0.0/24)
- ✅ Port Ranges - Check port ranges (8000-8100) or multiple ports (80,443,8080)
- ✅ CSV File Support - Read from CSV files (host,port format)
- ✅ Dated Result Files - Automatic timestamped output files
- ✅ Progress Bar - Real-time progress tracking
- ✅ Version Information - Check tool version with -v flag
- ✅ Input Validation - Comprehensive validation with helpful warnings for malformed input
- ✅ Automatic Dependency Installation - Installs telnet and netcat if missing
- ✅ Flexible Input - File, stdin, or quick test mode
- ✅ Man Page & Tab Completion - Full documentation and bash completion
- ✅ Multi-OS Support - Ubuntu, Debian, CentOS, Fedora, Arch, openSUSE
sudo snap install netcheckEnable network diagnostics (required for -p and --my-ip flags):
sudo snap connect netcheck:network-observeBenefits: Auto-updates, universal Linux support, sandboxed security
Note: The
network-observeconnection is required for:
- ICMP ping tests (
-p/--pingflag)- Network interface information (
--my-ipflag)Without this connection, these features will fail with permission errors. All other features (TCP port tests, DNS lookup, HTTP status, SSL cert checks, retry logic) work without this connection.
# Build the package
./build-deb.sh
# Install
sudo dpkg -i netcheck_1.2.0.deb# Using Makefile (recommended)
sudo make install
# Or directly
sudo ./install.shThis will:
- Install the command as
netcheckin/usr/local/bin - Automatically detect your OS and install dependencies (telnet, netcat)
- Create a man page (
man netcheck) - Add bash tab completion
- Works on: Ubuntu, Debian, CentOS, RHEL, Fedora, Arch, openSUSE
chmod +x check_ip.sh
# Run directly: ./check_ip.shSee: PUBLISHING_GUIDE.md for package publishing details
# Test a single host - no files created, instant results
netcheck -q google.com 443
netcheck -q 192.168.1.1 80
netcheck -q localhost 3306
# Test multiple ports at once
netcheck -q server.com 80,443,8080
netcheck -q localhost 80,443
# Test port range
netcheck -q localhost 8000-8100
netcheck -q server.com 9000-9010
# NEW: Test IP range (multiple hosts)
netcheck -q 10.90.95.72-75 50000
netcheck -q 192.168.1.1-10 22# Resolve hostname to IP addresses
netcheck -d google.com
netcheck -d github.com
# NEW: Also accepts URLs (strips scheme/path automatically)
netcheck -d https://api.example.com
netcheck -d http://services.company.com:8080/path# Ping a host (4 packets with statistics)
netcheck -p 8.8.8.8
netcheck -p google.com
# NEW: Also accepts URLs (strips scheme/path automatically)
netcheck -p https://github.com
netcheck -p http://api.example.com# Show active network interfaces only (default)
netcheck --my-ip
netcheck -ip
# Show all interfaces including inactive ones
netcheck --my-ip --allOutput:
Network Interface Information
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📡 Active Network Interfaces (UP only):
Use '--my-ip --all' to show all interfaces
Interface: enp1s0
IPv4: 10.90.19.195
Status: ✅ UP
Interface: wlp0s20f3
IPv4: 192.168.0.137
Status: ✅ UP
🌐 Default Gateway: 192.168.0.1
Via Interface: wlp0s20f3
🌍 Public IP Address:
154.91.162.123
# Check HTTP/HTTPS status codes
netcheck -s https://google.com
netcheck -s http://api.example.com
# Get detailed headers with verbose mode
netcheck -s https://github.com -VOutput:
HTTP Status Check for: https://google.com
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Sending HTTP request...
┌─────────────────────────────────────────────┐
│ URL: https://google.com │
├─────────────────────────────────────────────┤
│ Status: ✅ SUCCESS │
│ Code: 200 OK │
│ Response Time: 145ms │
│ Content Size: 15.2 KB │
└─────────────────────────────────────────────┘
# Check SSL/TLS certificate
netcheck --cert https://google.com
netcheck --cert github.com:443
# Verbose mode shows SANs (Subject Alternative Names)
netcheck --cert google.com -VOutput:
SSL/TLS Certificate Check for: google.com:443
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Connecting to google.com:443...
┌─────────────────────────────────────────────┐
│ Host: google.com:443 │
├─────────────────────────────────────────────┤
│ Status: ✅ VALID │
├─────────────────────────────────────────────┤
│ Certificate Details: │
├─────────────────────────────────────────────┤
│ Subject: CN = *.google.com │
│ Issuer: C = US, O = Google Trust Servi... │
├─────────────────────────────────────────────┤
│ Valid From: Oct 15 08:15:42 2024 GMT │
│ Valid Until: Jan 7 08:15:41 2025 GMT │
│ Days Until Expiry: 62 │
└─────────────────────────────────────────────┘
# Retry failed connections 3 times (works with all modes)
netcheck --retry 3 hosts.txt
# Custom retry delay (default: 1 second)
netcheck --retry 3 --retry-delay 2 hosts.txt
# Works in quick mode too
netcheck -q 192.168.1.1 80 --retry 5 --retry-delay 1# Check netcheck version
netcheck -v
netcheck --versionOutput:
DNS Lookup for: google.com
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Hostname: google.com
IP Addresses:
142.250.202.78
2a00:1450:4019:812::200e (IPv6)
Aliases:
Reverse DNS:
pnfjra-an-in-f14.1e100.net.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Check netcheck version
netcheck -v
netcheck --versionOutput:
Quick Test Mode
Host: localhost
Port(s): 80,443
Timeout: 5s
Testing 2 port(s)...
┌─────────────────────────────────────────────┐
│ Host: localhost │
│ Port: 80 │
├─────────────────────────────────────────────┤
│ Status: ✓ CONNECTED │
│ Method: netcat │
│ Response Time: 1ms │
└─────────────────────────────────────────────┘
Quick Test Summary
════════════════════════════════════════════
Total Ports: 2
Successful: 1
Failed: 1
════════════════════════════════════════════
# Read from CSV file
netcheck --csv hosts.csv
# CSV from stdin
cat hosts.csv | netcheck --csv
# Piped CSV data
echo -e "host,port\ngoogle.com,443\nlocalhost,80" | netcheck --csvCSV Format:
host,port
google.com,443
server.local,80
192.168.1.1,22
192.168.1.1-5,80
localhost,"80,443,8080"
10.0.0.0/24,22
Features:
- Automatic header detection and skipping
- Supports quoted fields for multiple ports
- Supports IP ranges in CSV:
192.168.1.1-50,80 - Supports CIDR notation:
192.168.1.0/24,22 - Supports multiple ports:
host,"80,443,8080"
Create a file hosts.txt:
google.com 443
github.com 443
192.168.1.1 80
localhost 3306
8.8.8.8 53
Run the check:
netcheck hosts.txtnetcheck [OPTIONS] [input_file]
OPTIONS:
-t, --timeout <seconds> Connection timeout (default: 5)
-j, --jobs <number> Max parallel jobs (default: 10)
-V, --verbose Verbose output
-f, --format <format> Output format: text, json, csv, xml (default: text)
-c, --combined Create combined report with all results
-q, --quick <host> <port> Quick test mode (no files created)
-o, --output <file> Save quick mode results to file
-d, --dns <hostname> Resolve DNS and show IP address (accepts URLs)
-p, --ping <host> Ping host using ICMP (accepts URLs/IPs)
-s, --status <url> Check HTTP/HTTPS status code and response time
--cert <host> Check SSL/TLS certificate validity and expiration
--my-ip, -ip Show all network interfaces and IP addresses (UP only)
--my-ip --all Show all interfaces including inactive ones
--retry <number> Retry failed connections N times (default: 1, no retry)
--retry-delay <seconds> Delay between retries in seconds (default: 1)
--csv Input file is in CSV format (host,port)
-v, --version Show version information
-h, --help Show help message
# Check hosts from file
netcheck hosts.txt
# From stdin
cat hosts.txt | netcheck
# Verbose mode
netcheck -V hosts.txt
echo "google.com 443" | netcheck -V# Lookup hostname
netcheck -d google.com
netcheck -d github.com
# Works with URLs too (strips http://, https://, paths)
netcheck -d https://api.example.com
netcheck -d http://services.company.com:8080/api/v1# Ping IP address
netcheck -p 8.8.8.8
netcheck -p 192.168.1.1
# Ping hostname
netcheck -p google.com
# Works with URLs too
netcheck -p https://github.comnetcheck -d google.com netcheck -d github.com
### Version Check
```bash
# Show netcheck version
netcheck -v
netcheck --version
# Check 20 hosts simultaneously with 2-second timeout
netcheck -t 2 -j 20 hosts.txt
# High-speed scanning with 100 parallel jobs
netcheck -j 100 -t 1 large-list.txtJSON Output:
netcheck -f json hosts.txtOutput: result.txt
{"check_date":"2025-11-11 10:59:21","results":[
{"status":"success","host":"google.com","port":443,"method":"netcat","timestamp":"2025-11-11 10:59:21"}
]}CSV Output:
netcheck -f csv hosts.txtOutput: result.txt
Status,Host,Port,Method,Timestamp
"SUCCESS","google.com",443,"netcat","2025-11-11 11:00:05"
XML Output:
netcheck -f xml hosts.txt# Get all results (success + failures) in one file
netcheck -c hosts.txt
# Creates: combined-2025-11-11.txt# See detailed output for each host
netcheck -v hosts.txtEach line should contain: HOST PORT(S)
# Basic format
192.168.1.1 80
# Multiple ports (comma-separated)
192.168.1.1 80,443,8080
# Port range
192.168.1.1 8000-8100
# IP range (last octet)
192.168.1.1-50 80
# CIDR notation (subnet)
192.168.1.0/24 80
# Combined: IP range + multiple ports
192.168.1.1-10 80,443,8080
# Comments are supported
# This is a comment
google.com 443
IP Ranges:
192.168.1.1-50 80- Checks 192.168.1.1 through 192.168.1.50 on port 80 (50 checks)10.0.0.1-5 443- Checks 5 IPs on port 443
CIDR Notation:
192.168.1.0/24 80- Checks entire /24 subnet (254 hosts)10.0.0.0/28 22- Checks /28 subnet (14 usable hosts)- Note: Network and broadcast addresses are skipped for /24 and smaller
Multiple Ports:
server.com 80,443,8080- Checks 3 ports on same host192.168.1.1 22,80,443,3306,8080- Checks 5 ports
Port Ranges:
localhost 8000-8100- Checks ports 8000 through 8100 (101 ports)server.com 9000-9010- Checks 11 ports- Note: Port ranges >1000 ports are limited to first 1000
Combined:
192.168.1.1-10 80,443- 10 IPs × 2 ports = 20 checks10.0.0.0/28 22,80,443- 14 IPs × 3 ports = 42 checks
- result.txt - Successful connections
- fail-YYYY-MM-DD.txt - Failed connections (dated)
- combined-YYYY-MM-DD.txt - All results (when using
-cflag)
#!/bin/bash
# Check if database is up
if netcheck -q db.example.com 3306 > /dev/null 2>&1; then
echo "Database is online!"
else
echo "Database is down!"
exit 1
fi
# Batch check and parse JSON
netcheck -f json servers.txt
# Process result.txt with jq or other JSON tools- Bash 4.0+
- telnet (auto-installed)
- netcat (auto-installed)
- timeout command (usually pre-installed)
If automatic installation fails, install manually:
Ubuntu/Debian:
sudo apt install telnet netcat-openbsdCentOS/RHEL/Fedora:
sudo yum install telnet nc
# or
sudo dnf install telnet ncArch/Manjaro:
sudo pacman -S inetutils openbsd-netcatMake sure the script is executable:
chmod +x check_ip.shFor system-wide installation, use sudo:
sudo ./install.shsudo ./uninstall.shThis removes:
/usr/local/bin/netcheck- Man page
- Bash completion
Dependencies (telnet, netcat) are NOT removed.
View full manual:
man netcheck# Check SSH on entire /24 subnet
echo "192.168.1.0/24 22" | netcheck -j 50
# Check common web ports on subnet
echo "10.0.0.0/26 80,443,8080" | netcheck -f csv# Scan port range on single host
echo "server.local 1-1024" | netcheck -j 100 > scan-results.txt
# Check common service ports
echo "192.168.1.1 22,80,443,3306,5432,6379,8080,9000" | netcheck# Find active hosts in range
cat << EOF | netcheck -j 20
192.168.1.1-254 22
192.168.1.1-254 80
192.168.1.1-254 443
EOF# Check multiple subnets with multiple ports
cat << EOF | netcheck -f json -c
192.168.1.0/24 80,443
192.168.2.0/24 80,443
10.0.0.0/24 22,3389
EOF# Check web servers cluster
echo "web-{01..10}.prod.com 80,443" > servers.txt
# Expand in bash, then check
for i in {1..10}; do echo "web-$(printf %02d $i).prod.com 80,443"; done | netcheck -j 20# Check every 5 minutes (add to crontab)
*/5 * * * * /usr/local/bin/netcheck /path/to/hosts.txt# Generate CSV and open in Excel
netcheck -f csv hosts.txt
libreoffice result.txt# Check and POST results to monitoring API
netcheck -f json hosts.txt
curl -X POST https://api.monitor.com/results \
-H "Content-Type: application/json" \
-d @result.txt#!/bin/bash
# health-check.sh
CRITICAL_SERVICES=(
"db.prod.com 3306"
"api.prod.com 443"
"cache.prod.com 6379"
)
for service in "${CRITICAL_SERVICES[@]}"; do
if ! netcheck -q $service > /dev/null 2>&1; then
echo "ALERT: $service is down!"
# Send notification
fi
done- README.md - Main documentation (this file)
- EXAMPLES.md - Comprehensive examples and real-world scenarios
- INPUT_VALIDATION.md - Input format and validation guide
- INSTALL.md - Installation instructions
- MAKEFILE_GUIDE.md - Understanding the Makefile
- DEB_PACKAGING.md - How to create DEB packages
- SNAP_PACKAGING.md - How to create Snap packages
- PUBLISHING_GUIDE.md - Quick reference for publishing
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open-source. See LICENSE file for details.
Network Access Check Tool
- Report issues on GitHub
- Check man page:
man netcheck - See examples: EXAMPLES.md # Send alert email/SMS fi done
## Contributing
Contributions welcome! Please test on your OS and submit pull requests.
## License
GNU General Public License v3 (GPL-3.0)
This project is licensed under GPL v3, which means:
- ✅ Free to use for any purpose
- ✅ Free to modify and improve
- ✅ Free to distribute
- ✅ Can be used commercially
- ⚠️ Any modifications must also be open source (copyleft)
- ⚠️ Cannot create proprietary closed-source versions
See [LICENSE](LICENSE) file for full details.
## Version
Version 1.0.0 - November 2025
Check version: `netcheck -v` or `netcheck --version`
## Documentation
- **[README.md](README.md)** - Main documentation (this file)
- **[EXAMPLES.md](EXAMPLES.md)** - Comprehensive examples and real-world scenarios
- **[INSTALL.md](INSTALL.md)** - Installation instructions
- **[MAKEFILE_GUIDE.md](MAKEFILE_GUIDE.md)** - Understanding the Makefile
- **[DEB_PACKAGING.md](DEB_PACKAGING.md)** - How to create DEB packages
- **[SNAP_PACKAGING.md](SNAP_PACKAGING.md)** - How to create Snap packages
- **[PUBLISHING_GUIDE.md](PUBLISHING_GUIDE.md)** - Quick reference for publishing
## Support
For issues and questions:
- Check `man netcheck` for full documentation
- Run `netcheck --help` for quick reference
- Run `netcheck -v` for version information
- Run `netcheck -d <hostname>` for DNS lookup
- View logs in result.txt and fail-*.txt files
- Report issues on GitHub