• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rm-hull / dot-block / 26778567768
47%

Build:
DEFAULT BRANCH: main
Ran 01 Jun 2026 07:59PM UTC
Jobs 1
Files 20
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Jun 2026 07:59PM UTC coverage: 45.026% (+1.7%) from 43.282%
26778567768

push

github

web-flow
fix: short circuit DNS-SD queries (#132)

* feat: short circuit DNS-SD queries (RFC 6763)

Prevent DNS-SD queries (matching *._dns-sd._udp.*, excluding _services.*) from being forwarded upstream by returning NXDOMAIN.

* chore: iterative updates from Gemini based on PR comment

I have implemented and verified a new test case, `TestDNSDispatcher_HandleDNSRequest_MixedBlockedAndUpstream`, in `internal/forwarder/dispatcher_test.go`. This test specifically exercises the dispatcher's handling of mixed requests—simultaneously querying a blocked domain and a valid upstream domain—ensuring correct behavior for both.

All existing and new tests in the `internal/forwarder` package have passed, confirming the implementation is robust and functional.

* chore: iterative updates from Gemini based on PR comment

I have successfully implemented the requested test case `TestDNSDispatcher_HandleDNSRequest_DNSSD_NXDOMAIN` in `internal/forwarder/dispatcher_test.go`.

The test verifies that the DNS dispatcher correctly returns `NXDOMAIN` for requests matching `db._dns-sd._udp.0.68.168.192.in-addr.arpa` and confirms that the upstream DNS server is not queried for such requests. All tests in the package passed successfully.

* fix: handle NXDOMAIN for non-SDNS queries

Ensure that DNS requests for non-SDNS queries explicitly return an
`NXDOMAIN` (Name Error) response code instead of potentially returning
an empty successful response.

This improves RFC compliance for DNS resolution logic.

* chore: iterative updates from Gemini based on PR comment

I have implemented the requested handling for RFC 2606 / 6761 reserved TLDs.

### Changes:
1.  **Helper Functions**: Added `isReservedTLD` and `isReservedLocalhost` in `internal/forwarder/dispatcher.go`.
2.  **Dispatcher Logic**: Refactored `processQuestion` to return a `dns.Rcode` along with the response records, and integrated checks for reserved TLDs and `localhost` (loopback).
3.  **HandleDNSRequest**: Updated the request pr... (continued)

53 of 54 new or added lines in 1 file covered. (98.15%)

688 of 1528 relevant lines covered (45.03%)

1176.05 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
87.92
2.6% internal/forwarder/dispatcher.go
Jobs
ID Job ID Ran Files Coverage
1 26778567768.1 01 Jun 2026 07:59PM UTC 20
45.03
GitHub Action Run
Source Files on build 26778567768
  • Tree
  • List 20
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 6372b55f on github
  • Prev Build on main (#26748997607)
  • Next Build on main (#26782665238)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc