-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
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.