Conversation
The network panel's reachability sample pinged a single hardcoded address, 1.1.1.1. Networks that blackhole that address -- ISPs and consumer routers that used it internally before Cloudflare did -- left the panel reporting "Ping: Timeout" and "Packet Loss: 100%" permanently, while the internet worked fine. Probe the resolvers the system is configured to use instead, falling back to a list of public addresses. Only public unicast IPv4 addresses qualify: a resolver on the LAN, which is what `omarchy dns DHCP` usually yields, would report the internet as reachable whenever the router answered, and the systemd-resolved stub listens on loopback. Candidates are probed concurrently, so a sample still costs one ping timeout rather than one per address, and reporting the best answer means a single blocked address no longer blanks the reading. Route lookup keeps its own fixed public address. It resolves against the local routing table, where reachability is irrelevant, and pointing it at a configured resolver could return an on-link route instead of the default one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Improves network status detection by probing multiple public DNS addresses concurrently instead of relying on one address.
Changes:
- Selects configured public IPv4 resolvers with public fallbacks.
- Separates route lookup from reachability probing.
- Adds shell tests for probe selection and outage behavior.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
bin/omarchy-network-status |
Adds probe selection and concurrent latency sampling. |
test/shell.d/network-status-probe-test.sh |
Tests address filtering, fallback selection, and outage handling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| probes=$(PATH="$stub:$PATH" bash -c "$(declare -f is_public_ipv4 configured_dns_servers internet_probes) | ||
| fallback_probes=(1.1.1.1 8.8.8.8 9.9.9.9) | ||
| max_probes=3 | ||
| internet_probes" | tr '\n' ' ') |
| eval "$(sed -n '/^ping_latency_ms()/,/^}$/p' "$STATUS")" | ||
| eval "$(sed -n '/^ping_internet_ms()/,/^}$/p' "$STATUS")" | ||
| workdir=$(mktemp -d) | ||
| result=$(PATH="$stub:$PATH" ping_internet_ms "$workdir") |
resolvectl prints a server as addr[:port][%ifname][#name], and omarchy dns writes its Cloudflare, Google and DNS-over-TLS custom servers with the #name, so is_public_ipv4 rejected every one and the configured resolvers were silently replaced by the fixed fallbacks. On a network that also blocks those, the user's own public resolver was never tried. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
Clash and Mihomo in fake-IP TUN mode hand out resolvers inside 198.18.0.0/15, and the proxy answers for them itself, so probing one would keep reporting the internet as reachable through an outage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Reviewed and verified on a disposable Omarchy VM. The bug is real and this fixes it. I pushed two small fixes to your branch. Reproduction. With nft dropping all output to Pushed:
Not changed, for the maintainer to weigh:
Second opinion. Codex Medium reviewed the change twice. The first round found the suffix and This now waits on the maintainer. |
Problem
omarchy-network-statusmeasures internet reachability by pinging a single hardcoded address:Some networks blackhole
1.1.1.1outright. A number of ISPs and consumer routers used it internally before Cloudflare acquired it, and those blocks are still around. On such a network the address fails for every protocol, not just ICMP:1.1.1.11.0.0.1(Cloudflare's own secondary)8.8.8.89.9.9.9The route is normal and nothing on the LAN claims the address, so this is an upstream block, not a local fault. The result is that the network panel permanently shows Ping: Timeout and Packet Loss: 100% on a working connection:
Related:
omarchy dns Cloudflarealso sets1.1.1.1as the primary resolver, which is a dead server on these networks. That is a separate issue and not addressed here.Change
Derive the probe targets from the resolvers the system is actually configured to use — via
resolvectl dns, falling back to/etc/resolv.conffor hosts not running systemd-resolved — and fall back to a list of public addresses when none qualify.Three details worth calling out:
Only public unicast IPv4 addresses qualify as probes.
omarchy dns DHCPcommonly yields a resolver inside the LAN. Probing that would report the internet as reachable whenever the router answered, which is a worse bug than the one being fixed. The systemd-resolved stub also listens on loopback. Private, loopback, link-local, CGNAT, and multicast/reserved ranges are all rejected.Candidates are probed concurrently and the best answer wins. A sample still costs one ping timeout rather than one per address, and a single blocked address no longer blanks the reading.
Route lookup keeps its own fixed public address.
internet_probewas doing double duty —ip route getused it to find the interface carrying default traffic. That lookup is answered from the local routing table, so reachability is irrelevant there, but pointing it at a configured resolver could return an on-link route instead of the default one. It is now a separateroute_probe.Result
On a network that blocks
1.1.1.1:Non-verbose output is byte-identical. A genuine outage still reports empty, verified with a stubbed
pingthat fails for every public address while the gateway answers.Tests
Adds
test/shell.d/network-status-probe-test.sh, covering:172.15.0.1,172.32.0.1,192.169.0.1,100.63.0.1)The test fails against the current code and passes with the change.
./test/cliand the shell suite pass.