Skip to content

Fix DNS rewrite CNAMEs for DHCP hostnames#8413

Open
puneetdixit200 wants to merge 1 commit into
AdguardTeam:masterfrom
puneetdixit200:fix-dnsrewrite-dhcp-cname
Open

Fix DNS rewrite CNAMEs for DHCP hostnames#8413
puneetdixit200 wants to merge 1 commit into
AdguardTeam:masterfrom
puneetdixit200:fix-dnsrewrite-dhcp-cname

Conversation

@puneetdixit200

Copy link
Copy Markdown

Closes #8068.

This updates the unresolved DHCP-host path to re-check the current request name after filtering rewrites a local-domain query to a CNAME target. When the rewritten name is a known DHCP hostname, the server now returns the local DHCP answer and lets post-filtering restore the original question and prepend the CNAME.

Tests:

  • go test ./internal/dnsforward -run TestServer_ProcessDHCPHosts_rewrittenCNAME -count=1
  • go test ./internal/dnsforward ./internal/filtering -count=1
  • go test -race ./internal/dnsforward -run 'TestServer_ProcessDHCPHosts|TestServer_ProcessUpstream' -count=1\n- make go-lint\n- git diff --check\n\nNotes:\n- make go-lint prints existing Go 1.26.3 standard-library govulncheck findings (GO-2026-5039, GO-2026-5037), and the target still passes with its configured non-reproducible vulnerability-scan ignore.\n- make go-test reached the touched internal/dnsforward package successfully, then failed later in internal/home because TestWeb_HandleGetProfile/add_user timed out after 1m30s while running bcrypt under the race detector. The isolated retry go test -race ./internal/home -run TestWeb_HandleGetProfile -count=1 -timeout 5m passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Malformed question from $dnsrewrite rules for DHCP hostnames

1 participant