Skip to content

vminfo net

Run one-off network diagnostics from the same binary you already use for host metrics. Each subcommand prints human-readable output by default and accepts --json for scripting.

Subcommands

ActionWhat it does
net dnsResolve a domain to addresses
net portTest TCP connectivity and latency to host:port
net pingProbe a host with TCP-dial or ICMP RTTs
net ipLook up public IP + ASN / geo info

net dns

bash
vminfo net dns example.com
vminfo net dns example.com --server 1.1.1.1
vminfo net dns example.com --server 1.1.1.1 --json
FlagDescription
positional domainThe domain to resolve (exactly one)
--serverDNS server as host or host:port; empty = system default
--jsonWrite the result as JSON

net port

bash
vminfo net port example.com 443
vminfo net port example.com 443 --timeout 3s --json
FlagDescription
host / portTarget host and port (1–65535)
--timeoutDial timeout, default 2s
--jsonWrite the result as JSON

net ping

bash
vminfo net ping example.com                       # TCP ping, port 80
vminfo net ping example.com --tcp-port 443        # TCP ping on 443
vminfo net ping example.com --mode icmp           # real ICMP ping (needs privileges)
vminfo net ping example.com --count 6 --json
FlagDescription
positional hostThe host to probe (exactly one)
--modetcp (default) or icmp
--countNumber of probes, default 4
--timeoutPer-probe timeout, default 1s
--tcp-portTCP target port, default 80 (tcp mode only)
--jsonWrite the result as JSON

TCP vs ICMP

tcp mode does TCP-dial RTTs — it is cross-platform and unprivileged, so it works anywhere. icmp mode sends real ICMP Echo packets via golang.org/x/net; on Linux it needs net.ipv4.ping_group_range to grant the unprivileged UDP ICMP socket, and it is unsupported on Windows. If ICMP is unavailable, switch to --mode tcp.

net ip

bash
vminfo net ip                       # your own public IP + ASN / geo
vminfo net ip 8.8.8.8               # look up a specific IP
vminfo net ip --json
FlagDescription
positional ipOptional IP to look up; omitted = your own public IP
--serverLookup service base URL, default https://ip.bestcheapvps.org
--jsonWrite the result as JSON

Outbound request

net ip makes an explicit, user-triggered request to a third-party lookup service (ip.bestcheapvps.org by default) to fetch ASN, geo, and risk flags. This is disclosed in --help and in the command output. It never runs automatically — only when you ask for it.

Notes

  • Human-readable output is localized; JSON output is stable and language-neutral.
  • JSON results echo timing in elapsed_ms and surface errors in an error field.
  • These diagnostics are also reachable from the web dashboard via POST /api/v1/net/diag.

Example

bash
vminfo net ping example.com --tcp-port 443 --count 4 --json
最近更新

Released under the MIT License.