Skip to content

Create PTR records for every IPv6 address of a cloaked name - #3419

Merged
jedisct1 merged 1 commit into
DNSCrypt:masterfrom
Dv2Corn:fix/cloak-ptr-every-ipv6
Nov 12, 2026
Merged

jedisct1 merged 1 commit into
DNSCrypt:masterfrom
Dv2Corn:fix/cloak-ptr-every-ipv6

Conversation

@Dv2Corn

@Dv2Corn Dv2Corn commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

With cloak_ptr = true and a name cloaked to more than one IPv6 address, only the first address resolves back to the name. With these cloaking rules:

nas.home.test   fd00::10
nas.home.test   fd00::11

a PTR query for fd00::11 is not answered by the cloaking plugin (it goes upstream), and the one for fd00::10 returns nas.home.test. twice. The same rules with two IPv4 addresses work.

When a rule is loaded, the IPv4 branch reverses the address of the current line, but the IPv6 branch reverses cloakedName.ipv6[0], the first IPv6 address collected for that name: plugin_cloak.go#L124-L139. It now uses the address of the current line as well.

Tested with a new unit test loading two IPv4 and two IPv6 addresses for one name (before: no PTR record for the second IPv6 address and a duplicate for the first; go test and go vet pass after), and with the built proxy in offline mode queried over UDP: before, PTR for fd00::11 is NXDOMAIN from the upstream stub and fd00::10 has two identical records; after, each address has one nas.home.test. record.

With cloak_ptr, the PTR record of an IPv6 rule was always built from the
first IPv6 address of the name. A second address got no PTR record, and
the first one got the name twice.
@jedisct1
jedisct1 merged commit 7b9e495 into DNSCrypt:master Nov 12, 2026
jedisct1 added a commit that referenced this pull request Nov 12, 2026
* 'master' of github.com:DNSCrypt/dnscrypt-proxy:
  Create PTR records for every IPv6 address of a cloaked name (#3419)
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.

2 participants