Network Commands

The network-base group provides host reachability checks, HTTP probing, port scanning, geolocation, WHOIS, traceroute, and local network information commands.

nadzoring network-base --help

network-base ping

Check ICMP reachability for one or more hosts.

nadzoring network-base ping [OPTIONS] HOST [HOST ...]
nadzoring network-base ping 8.8.8.8
nadzoring network-base ping google.com 1.1.1.1 cloudflare.com
nadzoring network-base ping -o json https://example.com

Python API

from nadzoring.network_base.ping_address import ping_addr

# Works with IPs, hostnames, and full URLs
if ping_addr("8.8.8.8"):
    print("Reachable")

# Note: ICMP may be blocked even for live hosts
reachable = ping_addr("https://google.com")

network-base http-ping

Probe a URL and measure DNS resolution, time-to-first-byte (TTFB), and total download time.

nadzoring network-base http-ping [OPTIONS] URL

Options

Option

Default

Description

--timeout

10.0

Request timeout in seconds

--no-ssl-verify

off

Skip SSL certificate verification

--no-follow-redirects

off

Do not follow HTTP redirects

--show-headers

off

Include response headers in output

Examples

nadzoring network-base http-ping https://example.com
nadzoring network-base http-ping --show-headers https://github.com
nadzoring network-base http-ping --timeout 5 --no-ssl-verify https://self-signed.example.com

Python API

from nadzoring.network_base.http_ping import http_ping

result = http_ping("https://example.com")

if result.error:
    print("Failed:", result.error)
else:
    print(f"Status:  {result.status_code}")
    print(f"DNS:     {result.dns_ms} ms")
    print(f"TTFB:    {result.ttfb_ms} ms")
    print(f"Total:   {result.total_ms} ms")
    print(f"Size:    {result.content_length} bytes")
    if result.final_url:
        print(f"Redirect→ {result.final_url}")

network-base host-to-ip

Resolve a hostname to its IPv4 address.

nadzoring network-base host-to-ip [OPTIONS] HOSTNAME
nadzoring network-base host-to-ip example.com
nadzoring network-base host-to-ip google.com github.com

Python API

from nadzoring.utils.validators import resolve_hostname

ip = resolve_hostname("example.com")
if ip is None:
    print("Resolution failed")
else:
    print(ip)  # "93.184.216.34"

network-base geolocation

Get geographic information for a public IP address.

nadzoring network-base geolocation [OPTIONS] IP [IP ...]
nadzoring network-base geolocation 8.8.8.8
nadzoring network-base geolocation 8.8.8.8 1.1.1.1 -o json

Python API

from nadzoring.network_base.geolocation_ip import geo_ip

result = geo_ip("8.8.8.8")

if not result:
    print("Geolocation unavailable")
else:
    print(f"{result['city']}, {result['country']}")
    print(f"Lat/Lon: {result['lat']}, {result['lon']}")

Note

ip-api.com rate-limits free callers to 45 requests per minute. Private addresses (e.g. 192.168.x.x) return an empty result.


network-base port-scan

Scan TCP or UDP ports on one or more targets.

nadzoring network-base port-scan [OPTIONS] TARGET [TARGET ...]

Options

Option

Default

Description

--mode

fast

Scan mode: fast (common ports), full (1–65535), custom

--protocol

tcp

Protocol: tcp or udp

--ports

Custom port range in start-end format (--mode custom)

--timeout

2.0

Per-port connection timeout in seconds

--workers

50

Number of concurrent threads

Examples

nadzoring network-base port-scan example.com
nadzoring network-base port-scan --mode full 192.168.1.1
nadzoring network-base port-scan --mode custom --ports 1-1024 example.com
nadzoring network-base port-scan --protocol udp --mode fast example.com

Python API

from nadzoring.network_base.port_scanner import ScanConfig, scan_ports

config = ScanConfig(
    targets=["example.com"],
    mode="fast",
    protocol="tcp",
    timeout=2.0,
)
results = scan_ports(config)

for scan in results:
    print(f"Target: {scan.target}  ({scan.target_ip})")
    print(f"Open ports: {scan.open_ports}")
    for port in scan.open_ports:
        r = scan.results[port]
        print(f"  {port}/tcp  {r.service}  {r.response_time}ms")
        if r.banner:
            print(f"  Banner: {r.banner[:80]}")

network-base port-service

Identify the service name associated with a port number.

nadzoring network-base port-service [OPTIONS] PORT [PORT ...]
nadzoring network-base port-service 80 443 22 3306

Python API

from nadzoring.network_base.service_on_port import get_service_on_port

print(get_service_on_port(80))    # "http"
print(get_service_on_port(22))    # "ssh"
print(get_service_on_port(9999))  # "unknown"

network-base whois

Perform a WHOIS lookup for a domain or IP address.

nadzoring network-base whois [OPTIONS] TARGET
nadzoring network-base whois example.com
nadzoring network-base whois 8.8.8.8
nadzoring network-base whois -o json --save whois.json example.com

Note

Requires the whois system utility. See /installation for installation instructions.


network-base traceroute

Trace the network path to a target host.

nadzoring network-base traceroute [OPTIONS] TARGET

Options

Option

Default

Description

--max-hops

30

Maximum number of hops

--timeout

2.0

Per-hop timeout in seconds

--sudo

off

Prefix command with sudo (Linux only)

nadzoring network-base traceroute 8.8.8.8
nadzoring network-base traceroute --max-hops 20 --sudo example.com

Note

On Linux, traceroute requires raw-socket privileges. Use --sudo, run as root, or grant the capability to the binary. tracepath is tried automatically as a fallback.


network-base connections

List active TCP/UDP connections (like netstat / ss).

nadzoring network-base connections [OPTIONS]
nadzoring network-base connections
nadzoring network-base connections --protocol tcp --state LISTEN
nadzoring network-base connections -o json --save conns.json

network-base route

Display the system IP routing table.

nadzoring network-base route [OPTIONS]
nadzoring network-base route
nadzoring network-base route -o json

network-base params

Show local network interface parameters: interface name, IPv4/IPv6, MAC address, gateway, and public IP.

nadzoring network-base params [OPTIONS]
nadzoring network-base params
nadzoring network-base params -o json --save net.json