[Feature] Add support for the MagicDNSPeerAAAA Node Attribute #1082

Open
opened 2025-12-29 02:28:10 +01:00 by adam · 3 comments
Owner

Originally created by @mindolo on GitHub (Aug 9, 2025).

Use case

Recent (1.84+) versions of tailscale support a new magicdns-aaaa node attribute that configures MagicDNS to respond to AAAA queries.

See references:

Description

#1027 is a (closed) issue to support AAAA records in MagicDNS. It was closed due to lack of Upstream support, but now that gap has closed significantly with the addition of the new magicdns-aaaa Node Attribute, this is an opt-in feature that users can enable.

In Tailscale this optin seems to be done via policies, but headscale is lacking support for NodeAttribute configuration in the policy (#2319)

There is a way to implement this via a global configuration tunable without requiring full NodeAttribute configuration capabilities.

Contribution

  • I can write the design doc for this feature
  • I can contribute this feature

How can it be implemented?

While there is a long term issue open to write support for Node Attribute configuration via policies (#2319) I think there is a quicker way to support the new feature in a similar way to RandomizeClientPort.

As it stands, RandomizeClientPort (headscale 0.26.1) is implemented as a configuration parameter (randomize_client_port in the yaml file) rather than an ACL policy tuneable, and it is set directly in the Node mapper: https://github.com/juanfont/headscale/blob/v0.26.1/hscontrol/mapper/tail.go#L124-L126

I am proposing to implement support for MagicDNSPeerAAAA in a very similar way.
If the config option is enabled and the Node has a valid Overlay IPv6, the NodeAttribute will be set, or skipped otherwise.

I have an implementation for this and the actual code change is minimal (4 lines in hscontrol/types/config.go and 3 in hscontrol/mapper/tail.go ignoring comments and tests).
I will be submitting a PR for this later today.

Originally created by @mindolo on GitHub (Aug 9, 2025). ### Use case Recent (1.84+) versions of tailscale support a new `magicdns-aaaa` node attribute that configures MagicDNS to respond to AAAA queries. See references: * https://github.com/ninech/tailscale/commit/9555912f29c404ac06d3b4a4b615f30e64b4c2c0 * https://github.com/tailscale/tailscale/issues/1152#issuecomment-3138350402 ### Description #1027 is a (closed) issue to support AAAA records in MagicDNS. It was closed due to lack of Upstream support, but now that gap has closed significantly with the addition of the new `magicdns-aaaa` Node Attribute, this is an opt-in feature that users can enable. In Tailscale this optin seems to be done via policies, but headscale is lacking support for NodeAttribute configuration in the policy (#2319) There is a way to implement this via a global configuration tunable without requiring full NodeAttribute configuration capabilities. ### Contribution - [ ] I can write the design doc for this feature - [x] I can contribute this feature ### How can it be implemented? While there is a long term issue open to write support for Node Attribute configuration via policies (#2319) I think there is a quicker way to support the new feature in a similar way to `RandomizeClientPort`. As it stands, RandomizeClientPort (headscale 0.26.1) is implemented as a configuration parameter (`randomize_client_port` in the yaml file) rather than an ACL policy tuneable, and it is set directly in the Node mapper: https://github.com/juanfont/headscale/blob/v0.26.1/hscontrol/mapper/tail.go#L124-L126 I am proposing to implement support for `MagicDNSPeerAAAA` in a very similar way. If the config option is enabled _and_ the Node has a valid Overlay IPv6, the NodeAttribute will be set, or skipped otherwise. I have an implementation for this and the actual code change is minimal (4 lines in `hscontrol/types/config.go` and 3 in `hscontrol/mapper/tail.go` ignoring comments and tests). I will be submitting a PR for this later today.
adam added the enhancementno-stale-bot labels 2025-12-29 02:28:10 +01:00
Author
Owner

@mindolo commented on GitHub (Aug 9, 2025):

Actually, integration tests may hold me back, I do have unittests though.

@mindolo commented on GitHub (Aug 9, 2025): Actually, integration tests may hold me back, I do have unittests though.
Author
Owner

@mindolo commented on GitHub (Aug 9, 2025):

I opened a draft PR to ask for help regarding the integration tests, on which i was stuck. But as soon as I opened the PR it all clicked and i was able to pass the test.
I will leave the pr as draft for now while discussion happens on this issue.

@mindolo commented on GitHub (Aug 9, 2025): I opened a draft PR to ask for help regarding the integration tests, on which i was stuck. But as soon as I opened the PR it all clicked and i was able to pass the test. I will leave the pr as draft for now while discussion happens on this issue.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 8, 2025):

This issue is stale because it has been open for 90 days with no activity.

@github-actions[bot] commented on GitHub (Nov 8, 2025): This issue is stale because it has been open for 90 days with no activity.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1082