Skip to content
DnsLister Forum

Where domain hunters compare notes

I have a network simulator that hunts for bugs in my own program, and today it opened its first real GitHub issue

I've been building an open-source project called Network Doctor, a terminal-based network diagnostic tool.

Recently I added something I've wanted for a while: a deterministic network simulator that can create controlled virtual networks using Linux network namespaces and then deliberately break them in different ways.

It can simulate things like:

  • DNS outages and recovery
  • packet loss, latency, and jitter
  • broken routes
  • IPv4/IPv6 failures
  • TCP resets
  • multiple interfaces and bad preferred routes
  • service failures

But the part I'm most excited about is the new hunt system.

Instead of me manually deciding what network to test, netdoc-sim hunt generates deterministic cases from fixed seeds, runs Network Doctor inside them, knows the actual simulator truth, and compares that truth against Network Doctor's diagnosis.

I then wired that into a nightly GitHub Actions workflow.

The workflow:

  1. Generates cases against several known-good baseline networks.
  2. Looks for disagreements between simulator truth and Network Doctor's diagnosis.
  3. Re-runs the exact seed + case to make sure the finding is reproducible.
  4. Ignores findings that it can't reproduce.
  5. Filters low-value findings by severity.
  6. Generates a stable fingerprint so the same bug isn't filed repeatedly.
  7. Checks GitHub for an existing issue.
  8. Opens a new issue only if the finding is reproducible and hasn't already been reported.

I was especially cautious about letting a fuzz-like system automatically create issues, so I ran it in observation-only mode first.

That turned out to be useful.

One of the initial findings claimed Network Doctor was missing routing evidence. When I investigated it, the hunter itself was wrong. It had mistaken IPv4 failure + IPv6 success on the same path for an alternate-route success.

So I fixed the hunt analyzer and reran everything.

Then it found this:

The simulator had deliberately caused a short DNS outage. DNS recovered roughly 677 ms into the test, but the DNS probe was still waiting until its ~4 second timeout and never queried the recovered resolver again.

The nightly triage reproduced the exact generated case, confirmed the fingerprints matched, and then opened GitHub issue #14 automatically.

The reproduction is deterministic:

./netdoc-sim hunt healthy-routed-network --seed 20260102 --case 3 --json

I ran it locally and got the same finding.

Then I ran the GitHub workflow again to test deduplication.

It found the bug again, saw that issue #14 already existed, and created zero duplicate issues.

That was a pretty satisfying moment.

The system is now basically:

generate network → inject fault → run Network Doctor → compare against ground truth → reproduce discrepancy → deduplicate → file issue

The current nightly suite runs 45 generated cases across healthy, routed, and dual-stack baseline networks in roughly 3 minutes on GitHub Actions.

There's still a lot I want to improve: more seeds, more scenarios, better cross-case verification, and making generated timeline mutations compose more cleanly with authored scenario tests. But this is the first time one of my projects has effectively gone out and found a bug/improvement for itself while I wasn't manually testing it.

I'm very proud of this.

Network Doctor is written in Go and the simulator currently uses Linux network namespaces.

GitHub: https://github.com/heymaikol/network-doctor

submitted by /u/mplaczek99 to r/commandline
[link] [comments]

Source: r/commandline · by /u/mplaczek99

Leave a Reply

Your email address will not be published. Required fields are marked *