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

rm-hull / dot-block / 19116214072
43%

Build:
DEFAULT BRANCH: main
Ran 05 Nov 2025 09:03PM UTC
Jobs 1
Files 6
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

05 Nov 2025 09:02PM UTC coverage: 50.564% (+6.8%) from 43.75%
19116214072

push

github

web-flow
refactor: Refactor DNS handling for granular cache (#3)

* refactor: Refactor DNS handling for granular cache

This refactoring significantly updates how DNS requests are processed,
improving caching efficiency and structure.

*   Change the cache payload from `*dns.Msg` to `[]dns.RR` to allow
    for granular caching of resource records per question.
*   Iterate over all questions in a request, checking the blocklist and
    cache individually.
*   If an upstream request is necessary, extract only the relevant
    answers from the response and cache them individually.
*   Simplify error handling and response sending utilities.

* test: Fix assertions for multiple DNS questions

Removes temporary assertions checking for incorrect NXDOMAIN
behavior in `TestDNSDispatcher_HandleDNSRequest_MultipleQuestions`.

The test now correctly asserts that a successful response
(`dns.RcodeSuccess`) is returned upon dispatching, along with
the expected number of answers.

* feat: Forward all unanswered questions upstream

Updates the DNS dispatcher to send all questions that were not
resolved by the internal cache to the upstream server in a
single request, rather than only sending the first question.

This commit also refactors the post-forwarding logic:

*   Optimizes answer parsing by grouping answers received from
    upstream into a map for fast lookup (`answerMap`).
*   Ensures cache keys are consistently fully qualified using
    `dns.Fqdn()`.

* feat: Send SOA record with NXDOMAIN response

Refactor DNS blocking logic into a dedicated helper function,
`sendNXDOMAIN`.

When a query is fully blocked, the response now includes a
Service of Authority (SOA) record in the authority section,
alongside the `RcodeNameError`.

This provides a more complete and compliant authoritative
response for blocked domains.

* fix: Set ID and RD when forwarding DNS queries

This fixes an issue where forwarded upstream DNS requests were
missing essential header fields.

The upstre... (continued)

100 of 111 new or added lines in 1 file covered. (90.09%)

3 existing lines in 1 file now uncovered.

224 of 443 relevant lines covered (50.56%)

0.54 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
11
83.9
7.98% internal/dns.go

Uncovered Existing Lines

Lines Coverage ∆ File
3
83.9
7.98% internal/dns.go
Jobs
ID Job ID Ran Files Coverage
1 19116214072.1 05 Nov 2025 09:03PM UTC 6
50.56
GitHub Action Run
Source Files on build 19116214072
  • Tree
  • List 6
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • ba3fe295 on github
  • Prev Build on main (#19086950487)
  • Next Build on main (#19116650580)
  • 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