Skip to content
sefaelbirPublic

About

Network intelligence CLI for domains and IP addresses: DNS, RDAP/WHOIS, ASN, geolocation, TLS and HTTP

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

netinfo: network intelligence for domains and IP addresses, in one command

netinfo

Network intelligence for domains and IP addresses, in one command.

netinfo combines DNS, RDAP/WHOIS registration data, IP ownership, ASN, approximate geolocation and TLS/HTTP inspection into a single, readable report, with stable JSON output for scripts.

netinfo example.com
netinfo sub.example.com --dns
netinfo 1.1.1.1
netinfo 2606:4700:4700::1111 --json

It is a single static binary for macOS, Linux and Windows. No runtime, no API key.


Contents

Features

  • Automatic target detection. It recognizes domains, subdomains, IPv4 and IPv6 addresses, internationalized domain names (münchen.de) and pasted URLs. It also identifies the registrable parent domain using the Public Suffix List, including shared hosting namespaces such as github.io.
  • DNS. Queries A, AAAA, CNAME (with chain), MX, NS, TXT, SOA, CAA and PTR records with TTLs. You can use the system resolver or a public/custom one (--resolver), and compare answers between resolvers (--compare).
  • Registration (RDAP first). Discovers the authoritative server via the IANA RDAP bootstrap registries, and follows thin-registry referrals to the registrar. It reports the registrar, dates, status, nameservers, DNSSEC, abuse contact and the publicly available registrant organization, and handles redacted data. It falls back to WHOIS only for TLDs without RDAP, and labels the result as best-effort.
  • IP intelligence. Shows address classification (IANA special-purpose registries), reverse DNS, the registry allocation (RIR RDAP: owner, CIDR, allocation type), the origin ASN and BGP prefix (operator), and approximate geolocation. It flags anycast only when there is evidence.
  • TLS. Reports certificate subject, issuer, validity, days remaining, SANs, chain, protocol, ALPN and key type. It verifies the chain and hostname, and warns about expired, soon-to-expire, untrusted or mismatched certificates.
  • HTTP (explicit --http only). Reports status, redirect chain, final URL, latency, server identification and security headers.
  • CDN / reverse-proxy detection. Inferences are backed by explicit evidence (CNAME targets, origin ASN, response headers), with a confidence level.
  • Robust by design. Lookups run concurrently with timeouts, retries, DNS server failover and bounded response sizes. When a provider fails you still get a partial report, with structured errors.
  • Readable everywhere. The default output is a compact summary with a one-line health overview; --full shows every field. Output is styled for dark and light terminals, adapts to narrow widths, falls back to ASCII, and switches to plain text when piped. All remote text is sanitized so DNS/WHOIS/HTTP data cannot inject terminal escape sequences.
  • Scriptable. JSON output follows a versioned, published JSON Schema. Exit codes are predictable.

Example output

The default view is a compact summary. A health line comes first; it is followed by the essentials of each section:

$ netinfo example.com --resolver cloudflare
   NETINFO   example.com
  Domain · 2 IPv4, 2 IPv6 · edge Cloudflare · 0.5s
  ✓ DNS  ✓ domain expires in 9 months  ✓ DNSSEC  ✓ TLS 60d

REGISTRATION ──────────────────────────────────────────────────  RDAP · rdap.verisign.com
  Expires        2027-08-13  in 9 months
  Created        1995-08-14  31 years 2 months ago
  Registrar      RESERVED-Internet Assigned Numbers Authority
  State          locked · DNSSEC signed

DNS ───────────────────────────────────────────────────────────  via 1.1.1.1 (Cloudflare)
  A              104.20.23.154, 172.66.147.243                      1m47s
  AAAA           2606:4700:10::6814:179a, 2606:4700:10::ac42:93f3   2m46s
  MX             null MX (accepts no email)                         5m
  NS             elliott.ns.cloudflare.com, hera.ns.cloudflare.com  22h
  TXT            "_k2n1y4vw3qtb4skdx9e7dxt97qrmmq9"                 1m30s
                 "v=spf1 -all"
  Empty          CAA

HOSTING ─────────────────────────────────────────────────────────  location via ipinfo.io
  Address        104.20.23.154, 2606:4700:10::6814:179a
  Operator       AS13335 Cloudflare, Inc.
  Location       San Francisco, United States ≈ approximate · anycast, one of many sites

TLS ────────────────────────────────────────────────────────────────────  example.com:443
  Status         ✓ valid · TLS 1.3 · h2
  Issuer         Cloudflare TLS Issuing ECC CA 3 · SSL Corporation
  Validity       2026-09-26 → 2026-12-25 (60 days left)
  SANs           example.com, *.example.com

  --full for all details · --json for scripts

The colors don't show here. In a terminal, a progress indicator also runs on stderr while lookups are in flight. Warnings and failures are always shown in the compact view; details such as SOA records, the certificate chain, response headers and abuse contacts are in --full.

An IP address keeps three things separate:

  • Owner: the RIR registration, i.e. who the address space is registered to.
  • Operator: the origin ASN, i.e. which network announces it in BGP.
  • Location: the geolocation estimate.

They are often different organizations; here APNIC owns the block and Cloudflare operates it:

$ netinfo 1.1.1.1
   NETINFO   1.1.1.1
  IPv4 address · 0.0s
  ✓ public address  • anycast

NETWORK ─────────────────────────────────────────────────────────  location via ipinfo.io
  Address        1.1.1.1 · IPv4
  Reverse DNS    one.one.one.one
  Operator       AS13335 Cloudflare, Inc. · 1.1.1.0/24
  Owner          APNIC Research and Development · 1.1.1.0/24 (APNIC)
  Location       Brisbane, Australia ≈ approximate · anycast, one of many sites

  --full for all details · --json for scripts

netinfo 1.1.1.1 --full shows every field. That includes allocation type, registry dates, abuse contacts, coordinates, time zone and the evidence behind the anycast flag.

Installation

Homebrew (macOS and Linux)

brew install sefaelbir/tap/netinfo

Scoop (Windows)

scoop bucket add sefaelbir https://github.com/sefaelbir/scoop-bucket
scoop install netinfo

Prebuilt binaries

Download the archive for your platform from GitHub Releases. Builds are available for:

OS Architectures
macOS arm64 (Apple Silicon), amd64 (Intel)
Linux arm64, amd64
Windows amd64

Verify the download against checksums.txt (SHA-256), extract it, and put netinfo on your PATH:

shasum -a 256 -c checksums.txt --ignore-missing
tar -xzf netinfo_*_linux_amd64.tar.gz
sudo install netinfo /usr/local/bin/

Archives include shell completions for bash, zsh, fish and PowerShell in completions/. You can also generate them with netinfo completion <bash|zsh|fish|powershell>.

macOS note: release binaries are not notarized. The Homebrew cask removes the quarantine attribute automatically. For a manually downloaded binary, run xattr -d com.apple.quarantine ./netinfo once.

With Go

go install github.com/sefaelbir/netinfo/cmd/netinfo@latest

This requires Go 1.26 or newer.

Usage

netinfo <domain | subdomain | IPv4 | IPv6 | URL> [flags]

Without lookup flags, netinfo runs a sensible default set:

Target Default lookups
Domain DNS, registration, network (ASN) and geolocation of resolved addresses, TLS
IP Classification, reverse DNS, registry allocation, ASN, geolocation

Lookup flags select specific sections and can be combined. --all runs everything applicable:

netinfo example.com --dns              # DNS only
netinfo example.com --whois --ssl      # registration + TLS
netinfo example.com --all              # adds HTTP, reverse DNS and allocation
netinfo example.com --http             # explicit HTTP inspection
netinfo 8.8.8.8 --geo                  # geolocation only
netinfo 8.8.8.8 --whois                # registry allocation (RDAP) for an IP
netinfo 2001:4860:4860::8888 --asn --reverse

For IP targets, --all never connects to the address itself. TLS and HTTP checks against an IP run only when you pass --ssl or --http.

DNS examples:

netinfo example.com --dns --resolver cloudflare      # query a public resolver
netinfo example.com --dns --resolver 192.168.1.1     # a specific server
netinfo example.com --dns --compare                  # system vs public answers

--compare shows whether your local resolver's A/AAAA answers match a public resolver. Differences are normal for CDNs and GeoDNS. Otherwise they can reveal filtering, split-horizon DNS or stale caches.

Command reference

Flag Description
Lookups
-a, --all Every applicable lookup (includes HTTP for domains)
--dns DNS records (A, AAAA, CNAME, MX, NS, TXT, SOA, CAA, PTR); reverse DNS for IPs
--whois Registration via RDAP with WHOIS fallback; registry allocation for IPs
--ssl, --tls TLS certificate and connection inspection
--http HTTP status, redirects, headers, latency (only when requested)
--geo Approximate IP geolocation
--asn Origin ASN / network operator
--reverse Reverse DNS (PTR)
Output
-f, --full Show every section and field (the default view is compact)
--json Shorthand for --output json
-o, --output table|json Output format (default table)
--no-color Disable colors (NO_COLOR is honored too)
--ascii ASCII symbols instead of Unicode
-q, --quiet No progress indicator, header, notes or hints
-v, --verbose Request logs and timings on stderr
Network
--timeout 8s Per-request timeout (the whole run is bounded at 3× plus 2s)
--resolver system (default), cloudflare, google, quad9, opendns, or IP[:port]
--compare Also query a public resolver and compare A/AAAA answers
--offline Local data only (MaxMind databases); no network requests
--allow-private Allow TLS/HTTP inspection of private, loopback and link-local addresses
--no-cache Do not read or write the response cache
Data sources
--geo-provider ipinfo (default), ipwhois, maxmind, none
--asn-provider cymru (default), maxmind, none
--maxmind-city-db PATH GeoLite2-City / GeoIP2-City .mmdb file
--maxmind-asn-db PATH GeoLite2-ASN .mmdb file
--config PATH Config file (see Configuration)
General
-h, --help Help
--version Version, commit, build date and platform

Exit codes

Code Meaning
0 A report was produced. Individual lookups may still have failed; check .errors in JSON
1 Runtime failure (e.g. output could not be written)
2 Invalid usage, invalid target or invalid configuration
130 Interrupted (Ctrl-C)

Progress indicators, notes and logs go to stderr. Stdout carries only the report.

JSON output

netinfo 8.8.8.8 --json
{
  "schema_version": "1.0",
  "target": { "input": "8.8.8.8", "normalized": "8.8.8.8", "type": "ipv4" },
  "addresses": [
    {
      "ip": "8.8.8.8",
      "version": 4,
      "classification": { "scope": "public", "public": true, "description": "Public global unicast" },
      "asn": {
        "status": "ok", "source": "team-cymru", "number": 15169, "name": "GOOGLE - Google LLC, US",
        "prefix": "8.8.8.0/24", "country": "US", "registry": "ARIN", "allocated": "2023-12-28"
      },
      "geo": {
        "status": "ok", "provider": "ipinfo.io", "country_code": "US", "city": "Mountain View",
        "latitude": 38.0088, "longitude": -122.1175,
        "accuracy": "approximate; city-level at best, often only region- or country-accurate"
      }
    }
  ],
  "errors": []
}

(Excerpt. The full report also contains tool, generated_at, duration_ms, reverse_dns, allocation, anycast and all geolocation fields.)

The contract:

  • The output is described by schema/report.schema.json, and the test suite validates real output against it. schema_version follows MAJOR.MINOR: minor versions only add fields, and a major bump signals a breaking change.
  • There are no ANSI sequences and no spinner output; stdout is pure JSON.
  • Unknown values are omitted, never guessed. Sections you requested are always present and carry a status of ok, partial, error, skipped or empty. Skipped and empty sub-sections carry a reason.
  • dns.records contains a key for every queried type. An empty array means "queried, none exist".
  • errors is always an array. Each entry has section, code, message, and optionally target and source. Codes are stable: timeout, nxdomain, not_found, rate_limited, no_service, blocked, tls, network, http_status, invalid_response, response_too_large, invalid_target, …

Some recipes:

netinfo example.com --dns --json | jq -r '.dns.records.A[].value'
netinfo example.com --ssl --json | jq '.tls.certificate.days_remaining'
netinfo example.com --whois --json | jq -r '.registration.expires'
netinfo 8.8.8.8 --json | jq '.addresses[0].asn.number'
netinfo example.com --json | jq -e '.errors | length == 0' >/dev/null && echo "all lookups ok"

Data sources

Data Source Transport Key needed
DNS records Your system resolver, or the one passed with --resolver DNS (UDP, TCP on truncation) No
Domain registration RDAP server discovered via the IANA bootstrap registry, plus the registrar's RDAP server when the registry refers to it HTTPS (HTTP only if a registry publishes nothing else) No
WHOIS fallback whois.iana.org referral, then the TLD's WHOIS server. Used only when no RDAP service exists for the TLD TCP port 43 (plaintext) No
IP allocation Regional Internet Registry RDAP (ARIN, RIPE NCC, APNIC, LACNIC, AFRINIC) via the IANA bootstrap HTTPS No
Origin ASN / BGP prefix Team Cymru IP-to-ASN DNS service, or a local GeoLite2-ASN database DNS through your resolver / local No
Geolocation ipinfo.io (default), ipwho.is, or a local MaxMind GeoLite2/GeoIP2-City database HTTPS / local No (optional ipinfo token)
Anycast evidence Provider flag (ipinfo.io) or a built-in list of documented anycast service addresses n/a No
TLS / HTTP The target itself TLS / HTTP(S) No

Authoritative and estimated data. DNS answers, RDAP and RIR records are authoritative statements by the respective operators. WHOIS fallback output is parsed heuristically and labeled as such. Geolocation, anycast and CDN detection are estimates. Every estimate names its provider or evidence.

Free provider tiers have rate limits and terms of use. ipinfo.io's free tier works without a token; add one for higher limits. ipwho.is's free tier is intended for non-commercial use. Check each provider's terms for your use case.

Privacy

netinfo has no telemetry, embeds no API secrets and collects no credentials. Running it still means asking third parties about your target, so it is worth knowing exactly who sees what.

Passive and active requests

  • Passive lookups ask data services about the target: DNS, RDAP, WHOIS, ASN and geolocation. They do not connect to the target host.

  • Active checks connect to the target:

    • TLS: a single handshake. It runs by default for domains, and for IPs only with --ssl.
    • HTTP: one GET per redirect hop, at most 10 hops. It runs only with --http or --all.

    These are not scans. Active checks connect to the addresses netinfo itself resolved, so they honor --resolver. By default they refuse to connect to loopback, private, link-local and other non-public addresses. That check happens on the actual socket address, so it also covers redirects and DNS rebinding. Use --allow-private to inspect internal hosts deliberately.

Who receives what (default settings)

Recipient Receives
Your DNS resolver The domain name and the record types queried. It also sees PTR and Team Cymru lookups, which contain resolved IPs
IANA (data.iana.org) Only bootstrap file downloads. These are cached for 24h and contain no target data
Domain registry / registrar RDAP The registrable domain name
TLD WHOIS server The registrable domain name, only for TLDs without RDAP. The query is plaintext
Regional Internet Registry RDAP The IP address (IP targets, or a domain's resolved addresses with --all)
Team Cymru (via DNS) The IP address, encoded in a DNS query name
Geolocation provider The IP address. Exactly one provider is used per run; netinfo never fans out to several
The target host A TLS handshake (and HTTP requests if requested), from your IP address

To reduce exposure:

  • Use --geo-provider none or --asn-provider none to turn those lookups off.
  • Use --geo-provider maxmind with local databases to keep geolocation on your machine.
  • Use --offline for local data only.
  • Select individual sections, e.g. --dns or --whois.

Caching. RDAP responses and geolocation results are cached for 1 hour, bootstrap files for 24 hours and WHOIS referrals for 7 days. Only successful responses are cached. The cache lives in your user cache directory (~/Library/Caches/netinfo on macOS, ~/.cache/netinfo on Linux, %LocalAppData%\netinfo on Windows) and is readable by your user only. It contains the names and addresses you looked up. Disable it with --no-cache or cache: false.

Geolocation accuracy

IP geolocation is an estimate. It reflects where a network is registered or routed, not where a person or device is:

  • City-level results are frequently wrong. Region or country is often the best achievable accuracy.
  • Coordinates are a placeholder for an area. Sometimes it is a city centroid, sometimes the center of a country. When a provider reports an accuracy radius (MaxMind does), netinfo shows it.
  • Anycast addresses (public DNS resolvers, CDNs) are served from many locations at once. The reported location is one of them, or simply the operator's headquarters.
  • VPNs, proxies, mobile carriers and CGNAT make the location of the network unrelated to the location of its users.

Never use netinfo's geolocation to locate an individual.

Configuration

Settings are read in this order, later sources overriding earlier ones:

  1. The config file
  2. Environment variables
  3. Command-line flags

The config file is optional. Its default location is the user config directory: ~/Library/Application Support/netinfo/config.yaml on macOS, ~/.config/netinfo/config.yaml on Linux and %AppData%\netinfo\config.yaml on Windows. Override it with --config or NETINFO_CONFIG. Unknown keys are rejected so typos don't go unnoticed.

# netinfo config.yaml
resolver: system            # system | cloudflare | google | quad9 | opendns | IP[:port]
timeout: 8s                 # per-request timeout
geo_provider: ipinfo        # ipinfo | ipwhois | maxmind | none
asn_provider: cymru         # cymru | maxmind | none
ipinfo_token: ""            # optional; raises ipinfo.io rate limits
maxmind_city_db: /path/to/GeoLite2-City.mmdb
maxmind_asn_db: /path/to/GeoLite2-ASN.mmdb
cache: true
cache_dir: ""               # default: user cache directory
no_color: false
view: compact               # compact | full (same as --full)

A commented example lives in docs/config.example.yaml.

Environment variable Equivalent
NETINFO_CONFIG --config
NETINFO_RESOLVER resolver
NETINFO_TIMEOUT timeout
NETINFO_GEO_PROVIDER geo_provider
NETINFO_ASN_PROVIDER asn_provider
NETINFO_IPINFO_TOKEN ipinfo_token
NETINFO_MAXMIND_CITY_DB maxmind_city_db
NETINFO_MAXMIND_ASN_DB maxmind_asn_db
NETINFO_CACHE_DIR cache_dir
NETINFO_NO_CACHE=1 cache: false
NETINFO_VIEW view
NO_COLOR no_color: true

Keep tokens out of shared config files; prefer the environment variable.

Offline geolocation with MaxMind GeoLite2

netinfo does not ship MaxMind data. GeoLite2 is free, but it requires an account and acceptance of the GeoLite2 license.

  1. Create an account at maxmind.com and generate a license key.
  2. Download GeoLite2-City and GeoLite2-ASN. MaxMind's geoipupdate tool keeps them current.
  3. Point netinfo at the files:
netinfo 8.8.8.8 --geo-provider maxmind --asn-provider maxmind \
  --maxmind-city-db ~/GeoIP/GeoLite2-City.mmdb --maxmind-asn-db ~/GeoIP/GeoLite2-ASN.mmdb

# Fully local: no DNS, RDAP or HTTP requests at all
netinfo 8.8.8.8 --offline --maxmind-city-db ~/GeoIP/GeoLite2-City.mmdb --maxmind-asn-db ~/GeoIP/GeoLite2-ASN.mmdb

In --offline mode, lookups that require the network are reported as skipped, with a reason, instead of failing.

Development

You need Go 1.26 or newer. Optional tools: golangci-lint v2 and GoReleaser v2.

git clone https://github.com/sefaelbir/netinfo && cd netinfo
go build -o bin/netinfo ./cmd/netinfo
./bin/netinfo example.com

The Makefile wraps the common tasks: make build, make test, make lint, make snapshot.

Project layout

cmd/netinfo/          entry point
internal/cli/         flags, config merging, spinner, exit codes
internal/target/      input validation, IDNA, Public Suffix List
internal/engine/      concurrent orchestration, partial results
internal/dnsx/        DNS client (miekg/dns), resolver selection, failover
internal/rdap/        RDAP bootstrap discovery, domain and IP lookups
internal/whois/       WHOIS fallback client and tolerant parser
internal/asn/         Team Cymru and MaxMind ASN providers
internal/geo/         ipinfo.io, ipwho.is and MaxMind geolocation providers
internal/tlsinspect/  TLS handshake and certificate analysis
internal/httpinspect/ bounded HTTP inspection with redirect tracking
internal/netguard/    blocks active checks against non-public addresses
internal/ipclass/     IANA special-purpose address classification
internal/cdn/         evidence-based CDN/proxy detection
internal/fetch/       HTTP client for providers (limits, retries, cache)
internal/cache/       on-disk TTL cache
internal/config/      YAML config and environment variables
internal/model/       report types (the JSON contract)
internal/render/      Lip Gloss terminal renderer and JSON writer
schema/               published JSON Schema for --json output

Testing

go test ./...                  # unit and integration tests
go test -race ./...            # with the race detector
go vet ./...
golangci-lint run

Tests are deterministic and never call live services:

  • DNS tests run against an in-process DNS server, covering truncation, packet loss and NXDOMAIN.
  • RDAP, WHOIS and geolocation parsers use real responses recorded into testdata/.
  • Provider clients are exercised against httptest servers or fake dialers.
  • TLS tests generate their own CA and certificates.
  • MaxMind tests build .mmdb files with MaxMind's writer.
  • JSON output is validated against the published schema.

CI runs the suite on Linux, macOS and Windows with the two latest Go releases, plus lint and a GoReleaser snapshot build.

Release process

Releases are automated with GoReleaser and GitHub Actions (.github/workflows/release.yml):

  1. Make sure main is green, then tag and push:
    git tag -a v1.1.0 -m "v1.1.0"
    git push origin v1.1.0
  2. The workflow runs the tests, then builds archives for all five targets with the version, commit and date embedded. It writes checksums.txt (SHA-256), publishes a GitHub Release with a generated changelog, and updates the Homebrew tap and Scoop bucket.

One-time setup for package managers:

  • Create the public repositories sefaelbir/homebrew-tap and sefaelbir/scoop-bucket.
  • Add the repository secrets HOMEBREW_TAP_GITHUB_TOKEN and SCOOP_BUCKET_GITHUB_TOKEN. These are fine-grained tokens with Contents: read and write on those repositories. Without them the release still succeeds, and the tap/bucket update is skipped.

To test a release locally: goreleaser release --snapshot --clean.

License

MIT.

MIT was chosen because it is the simplest widely understood permissive license. Anyone can use, modify, redistribute and package netinfo, including inside commercial and closed-source tooling and Linux distributions, with only attribution required. It is compatible with all dependencies (Apache-2.0, BSD-3-Clause, MIT and ISC licensed).

Data returned by third-party services remains subject to those services' terms.

About

Network intelligence CLI for domains and IP addresses: DNS, RDAP/WHOIS, ASN, geolocation, TLS and HTTP

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages