NextTrace, an open source visual route tracking CLI tool
NextTrace, an open source visual route tracking CLI tool
We are extremely grateful to DMIT, Misaka and SnapStack for providing the network infrastructure that powers this project.
Downstream developers: NextTrace will switch the default operating and display mode of
nexttraceandnexttrace-tinyto MTR no earlier than 2027. Using--rawalone will switch to MTR RAW at the same time. Traditional traceroute and its RAW output will remain available through-k/--traceroute. Programs relying on today's behavior should adopt--tracerouteor--traceroute --rawnow. This release does not change the default; the switching release will be announced separately.ntrremains MTR-only.
Document Language: English | 简体中文
⚠️ Please note: We welcome PR submissions from the community, but please submit your PRs to the NTrace-dev repository instead of NTrace-core repository.
Regarding the NTrace-dev and NTrace-core repositories:
Both will largely remain consistent with each other. All development work is done within the NTrace-dev repository. The NTrace-dev repository releases new versions first. After running stably for an undetermined period, we will synchronize that version to NTrace-core. This means that the NTrace-dev repository serves as a "beta" or "testing" version.
Please note, there are exceptions to this synchronization. If a version of NTrace-dev encounters a serious bug, NTrace-core will skip that flawed version and synchronize directly to the next version that resolves the issue.
nexttrace-debs APT repositoryamd64, i386, arm64, armel, armhf, loong64, mipsel, mips64el, ppc64el, riscv64, s390x…- Optionally install additional flavors:
```shell
sudo apt install nexttrace-tiny
sudo apt install ntr
```
- Packages can be installed side by side. Commands: `nexttrace`, `nexttrace-tiny`, `ntr`Linux / macOS / BSD
One-click installation script (Full, default)
curl -sL https://nxtrace.org/nt | bashOne-click installation script (Tiny)
curl -sL https://nxtrace.org/nt | bash -s -- --flavor tinyOne-click installation script (NTR)
curl -sL https://nxtrace.org/nt | bash -s -- --flavor ntrInstalled command names: Full nexttrace, Tiny nexttrace-tiny, NTR ntr
Arch Linux AUR installation command
yay -S nexttrace-binyay -S nexttraceLinuxbrew's installation command
Same as the macOS Homebrew installation method. The homebrew-core formula provides the Full flavor (nexttrace); the nxtrace/nexttrace tap provides all three flavors.
deepin installation command
apt install nexttracex-cmd installation command
x env use nexttraceTermux installation command
pkg install root-repo
pkg install nexttraceImmortalWrt installation command
opkg install nexttracemacOS
brew install nexttracenxtrace/nexttrace tap version (periodically synced from the latest NTrace-core release)brew tap nxtrace/nexttrace
brew install nxtrace/nexttrace/nexttrace
brew install nxtrace/nexttrace/nexttrace-tiny
brew install nxtrace/nexttrace/ntrWindows
Windows WinGet installation command
winget install nexttraceWindows Scoop installation command
scoop bucket add extras && scoop install extras/nexttracePlease note:
nexttrace-debs APT repository is maintained by nxtrace and wcbing.Download the precompiled executable
For users not covered by the above methods, please go directly to Release to download the compiled binary executable.
Release provides compiled binary executables for many systems and different architectures. If none are available, you can compile it yourself.Windows by Golang, so currently, NextTrace is in an experimental support phase on the Windows platform.Starting from this release, NextTrace is published in three flavors under the same tag. Choose the one that best fits your use case:
| Feature | nexttrace (Full) |
nexttrace-tiny |
ntr |
|---|---|---|---|
| Normal traceroute | ✅ | ✅ | — |
Environment check (--doctor) |
✅ | ✅ | ✅ |
Standalone MTU (--mtu) |
✅ | ✅ | — |
DNS client (-l / --dns) |
✅ | — | — |
CDN Speed (--speed) |
✅ | — | — |
IP annotation (--nali) |
✅ | — | — |
| MTR TUI | ✅ | ✅ | ✅ (default) |
MTR report (-r) |
✅ | ✅ | ✅ |
MTR wide (-w) |
✅ | ✅ | ✅ |
MTR raw (--raw) |
✅ | ✅ | ✅ |
| MTR JSON / NDJSON | ✅ | ✅ | ✅ |
MTR custom columns (--mtr-columns) |
✅ | ✅ | ✅ |
MTR recording / replay (--mtr-record / --mtr-replay) |
✅ | ✅ | ✅ |
Linux policy routing (--fwmark, local probes only) |
✅ | ✅ | ✅ |
Globalping (--from) |
✅ | — | — |
WebUI (--deploy) / MCP (--deploy --mcp) |
✅ | — | — |
Fast Trace (-F) |
✅ | ✅ | — |
| Default mode | traceroute | traceroute | MTR TUI |
| Binary name | nexttrace |
nexttrace-tiny |
ntr |
Note:
APT (nexttrace-debs)and theHomebrew tap (nxtrace/nexttrace)provide all three flavors: Full (nexttrace), Tiny (nexttrace-tiny), and NTR (ntr).homebrew-core, AUR, Scoop, and other package managers currently install the Full (nexttrace) version only.
nexttrace — Full-featured build. Includes traceroute, the standalone DNS client and MTU modes, CDN speed test, IP annotation, MTR, Globalping, Fast Trace, WebUI, and deploy MCP.nexttrace-tiny — Lightweight build. Keeps normal traceroute, standalone MTU, and Fast Trace. Includes optional MTR TUI, reports, and RAW. No DNS client / CDN speed test / IP annotation / Globalping / WebUI / MCP. Suitable for embedded or minimal environments.ntr — MTR-focused build. Runs MTR TUI by default. No normal traceroute mode, standalone DNS client or --mtu, CDN speed test, IP annotation, Globalping, Fast Trace, WebUI, or MCP.Build from source with Go 1.27.1+ installed. Release-equivalent builds use
GOEXPERIMENT=nojsonv2; the Go 1.27 default JSON runtime remains covered by CI,
but its WebSocket encoding cost does not meet the release performance threshold.
See the JSON runtime ADR.
export GOTOOLCHAIN=go1.27.1
export GOEXPERIMENT=nojsonv2
# Full (all features)
go build -trimpath -o dist/nexttrace -ldflags "-w -s" .
# Tiny (optional MTR; no DNS client, no Globalping, no WebUI)
go build -tags flavor_tiny -trimpath -o dist/nexttrace-tiny -ldflags "-w -s" .
# NTR (MTR-only)
go build -tags flavor_ntr -trimpath -o dist/ntr -ldflags "-w -s" .On macOS, source builds require macOS 13.0 or later, Xcode Command Line Tools, and cgo because TCP/UDP packet capture links against the system libpcap. For a native build, go env CGO_ENABLED must report 1. If it reports 0, remove any persistent override with go env -u CGO_ENABLED, ensure xcode-select -p succeeds, and build with CGO_ENABLED=1.
Cross-compile example:
# Linux arm64, Tiny flavor
GOTOOLCHAIN=go1.27.1 GOEXPERIMENT=nojsonv2 \
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 \
go build -tags flavor_tiny -trimpath -o dist/nexttrace-tiny_linux_arm64 -ldflags "-w -s" .Benchmark tooling is pinned in go.mod; compare saved results with go tool benchstat before.txt after.txt.
The tiny and ntr flavors use compile-time build tags to exclude modules — this is not a runtime switch. You can verify with go version -m <binary> that gin, globalping-cli, and github.com/natesales/q are absent from nexttrace-tiny and ntr.
The .cross_compile.sh script supports building flavors:
./.cross_compile.sh all # Build all three flavors for all platforms
./.cross_compile.sh full # Build only nexttrace (Full)
./.cross_compile.sh tiny # Build only nexttrace-tiny
./.cross_compile.sh ntr # Build only ntrRelease binaries follow this naming convention:
{binary}_{os}_{arch}[v{arm}][.exe][_softfloat]Examples:
nexttrace_linux_amd64, nexttrace-tiny_linux_amd64, ntr_linux_amd64nexttrace_darwin_universal, nexttrace-tiny_darwin_universal, ntr_darwin_universalnexttrace_windows_amd64.exe, ntr_windows_amd64.exeNextTrace uses the ICMP protocol to perform TraceRoute requests by default, which supports both IPv4 and IPv6
…Normal traceroute reports why it stopped: destination reached, a terminal unreachable response (including its marker), or the configured maximum hop count. --json keeps the existing top-level result shape and adds optional StopReason with lowercase nested fields hop, reason, responses, and markers; responses contains human-readable descriptions while markers contains machine-readable codes. Classic/raw/JSON modes do not receive an extra human-readable footer. --output writes the same plain stop line to the log without ANSI escapes.
--no-stop-reason hides all Trace Stopped: ... summaries in both the terminal and --output / --output-default files; they remain visible by default. Available in full and tiny builds, not ntr. It applies to normal traceroute, Fast
No open issues yet, or sync has not completed.