resolver: lower-case DNS names in record values (closes #157) #160

Merged
clawbot merged 1 commits from issue-157-case-insensitive-names into next 2026-09-29 00:30:30 +02:00
Collaborator

Record values now carry DNS names in lower case. extractRecordValue in internal/resolver/iterative.go lower-cases CNAME, MX, SRV and NS targets; A, AAAA, TXT and CAA values are formatted as before. DNS names are case-insensitive, and one nameserver for eeqj.de answers in upper case while the others answer in lower case, so the inconsistency check fired on every DNS cycle.

Because the values are lower-cased where they are built, the inconsistency check and the record-change check both compare equal strings; recordsEqual in the watcher is untouched. The dashboard, alerts and state file show the lower-case spelling. extractNSSet in the same file already lower-cases nameserver names the same way.

The test is a table test of extractRecordValue, reached through a new internal/resolver/export_test.go (the pattern other packages here use). It builds records in the test and formats them; no resolver, server or response is involved. The README hostname section gains one line on the lower-casing.

Closes #157

Disclosures:

  • State saved before this change can hold upper-case names; the first check after upgrading reports a one-time record change for those records. dnswatcher is not deployed anywhere yet.
  • Judgement call: the CAA tag keeps exact comparison along with the CAA value, as the issue asks, although CAA tags are themselves case-insensitive.

Model: opus-5-5

Record values now carry DNS names in lower case. `extractRecordValue` in `internal/resolver/iterative.go` lower-cases CNAME, MX, SRV and NS targets; A, AAAA, TXT and CAA values are formatted as before. DNS names are case-insensitive, and one nameserver for `eeqj.de` answers in upper case while the others answer in lower case, so the inconsistency check fired on every DNS cycle. Because the values are lower-cased where they are built, the inconsistency check and the record-change check both compare equal strings; `recordsEqual` in the watcher is untouched. The dashboard, alerts and state file show the lower-case spelling. `extractNSSet` in the same file already lower-cases nameserver names the same way. The test is a table test of `extractRecordValue`, reached through a new `internal/resolver/export_test.go` (the pattern other packages here use). It builds records in the test and formats them; no resolver, server or response is involved. The README hostname section gains one line on the lower-casing. Closes https://git.eeqj.de/sneak/dnswatcher/issues/157 Disclosures: - State saved before this change can hold upper-case names; the first check after upgrading reports a one-time record change for those records. dnswatcher is not deployed anywhere yet. - Judgement call: the CAA tag keeps exact comparison along with the CAA value, as the issue asks, although CAA tags are themselves case-insensitive. Model: opus-5-5
clawbot added the needs-review label 2026-09-28 23:18:41 +02:00
clawbot self-assigned this 2026-09-28 23:18:41 +02:00
Author
Collaborator
  • README.md (the new bullet in the hostname monitoring section) and the new comment on extractRecordValue in internal/resolver/iterative.go say TXT and CAA values are stored or kept "exactly as received". That is not true of the tree: the separate strings of a TXT record are joined into one, and quotes, backslashes and non-ASCII bytes are stored as escape sequences. Acceptable: say in both places that TXT and CAA values keep their letter case (are not lower-cased), without claiming they are stored exactly as received.

Model: opus-5-5

- `README.md` (the new bullet in the hostname monitoring section) and the new comment on `extractRecordValue` in `internal/resolver/iterative.go` say TXT and CAA values are stored or kept "exactly as received". That is not true of the tree: the separate strings of a TXT record are joined into one, and quotes, backslashes and non-ASCII bytes are stored as escape sequences. Acceptable: say in both places that TXT and CAA values keep their letter case (are not lower-cased), without claiming they are stored exactly as received. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-09-28 23:34:58 +02:00
clawbot added 1 commit 2026-09-28 23:48:59 +02:00
Nameservers may answer with DNS names in any letter case. For eeqj.de,
y.ns.joker.com answers in upper case while its peers answer in lower
case, so the inconsistency check fired on every cycle. extractRecordValue
now lower-cases CNAME, MX, SRV and NS targets, so the inconsistency check
and the record-change check both compare names regardless of case. A,
AAAA, TXT and CAA values are formatted as before. State saved before this
change can hold upper-case names, which report a one-time record change
on the first check after upgrading.

Model: opus-5-5
clawbot force-pushed issue-157-case-insensitive-names from 354db6b524 to 1d856a66c1 2026-09-28 23:48:59 +02:00 Compare
Author
Collaborator
  • README.md and the comment on extractRecordValue now say TXT and CAA values keep their letter case (are not lower-cased), with no claim that they are stored exactly as received.
  • The PR body and commit message now say A, AAAA, TXT and CAA values are "formatted as before" instead of "unchanged", so they cannot be read as the same claim.

Model: opus-5-5

- `README.md` and the comment on `extractRecordValue` now say TXT and CAA values keep their letter case (are not lower-cased), with no claim that they are stored exactly as received. - The PR body and commit message now say A, AAAA, TXT and CAA values are "formatted as before" instead of "unchanged", so they cannot be read as the same claim. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-09-28 23:49:13 +02:00
Author
Collaborator

Review passed on 1d856a6.

Model: opus-5-5

Review passed on 1d856a6. Model: opus-5-5
clawbot merged commit 95b017eb3e into next 2026-09-29 00:30:30 +02:00
clawbot deleted branch issue-157-case-insensitive-names 2026-09-29 00:30:30 +02:00
Sign in to join this conversation.