Support Split DNS #335

Closed
opened 2025-12-29 01:27:11 +01:00 by adam · 4 comments
Owner

Originally created by @coelho on GitHub (Sep 22, 2022).

Feature request

Split DNS is unsupported currently by Headscale. However, it can easily be supported!

It looks like dnsConfig.Resolvers decides whether or not the client overrides its Local DNS resolvers. If you comment out this line, Split DNS works perfectly:
https://github.com/juanfont/headscale/blob/main/config.go#L400

Would like feedback on how you would prefer this is implemented:

  • dns_config.override_dns (default: true) configuration flag (sets "Resolvers" if "true")
  • dns_config.split_dns (default: false) configuration flag (unsets "Resolvers" if "true")
  • dns_config.resolvers (default: alias to dns_config.nameservers) configuration flag.
    • Users can apply dns_config.resolvers: [] to enable Split DNS.

Can submit a PR if you'd like based on feedback :) Thanks!

Originally created by @coelho on GitHub (Sep 22, 2022). **Feature request** Split DNS is unsupported currently by Headscale. However, it can easily be supported! It looks like `dnsConfig.Resolvers` decides whether or not the client overrides its Local DNS resolvers. If you comment out this line, Split DNS works perfectly: https://github.com/juanfont/headscale/blob/main/config.go#L400 Would like feedback on how you would prefer this is implemented: - `dns_config.override_dns (default: true)` configuration flag (sets "Resolvers" if "true") - `dns_config.split_dns (default: false)` configuration flag (unsets "Resolvers" if "true") - `dns_config.resolvers (default: alias to dns_config.nameservers)` configuration flag. - Users can apply `dns_config.resolvers: []` to enable Split DNS. Can submit a PR if you'd like based on feedback :) Thanks!
adam added the enhancement label 2025-12-29 01:27:11 +01:00
adam closed this issue 2025-12-29 01:27:16 +01:00
Author
Owner

@kradalby commented on GitHub (Sep 26, 2022):

Happy to take a PR with the work and some tests :)

@kradalby commented on GitHub (Sep 26, 2022): Happy to take a PR with the work and some tests :)
Author
Owner

@madjam002 commented on GitHub (Sep 28, 2022):

Perhaps just a new config option dns_config.fallback_nameservers where the nameservers can be set but they're only used as a fallback, thus enabling Split DNS. dns_config.nameservers could then be left unset to enable Split DNS.

I've got split DNS working in my environment by renaming dnsConfig.Resolvers to dnsConfig.FallbackResolvers rather than commenting it out altogether.

@madjam002 commented on GitHub (Sep 28, 2022): > Perhaps just a new config option `dns_config.fallback_nameservers` where the nameservers can be set but they're only used as a fallback, thus enabling Split DNS. `dns_config.nameservers` could then be left unset to enable Split DNS. I've got split DNS working in my environment by renaming `dnsConfig.Resolvers` to `dnsConfig.FallbackResolvers` rather than commenting it out altogether.
Author
Owner

@coelho commented on GitHub (Sep 28, 2022):

@madjam002 Yes, but the operator should still have the option to not override at all if Split DNS is incompatible. That would be my preference.

@coelho commented on GitHub (Sep 28, 2022): @madjam002 Yes, but the operator should still have the option to not override at all if Split DNS is incompatible. That would be my preference.
Author
Owner

@kradalby commented on GitHub (Apr 19, 2023):

I will close this as it might have been fixed in newer version, please try a new release and reopen if it still does not work.

@kradalby commented on GitHub (Apr 19, 2023): I will close this as it might have been fixed in newer version, please try a new release and reopen if it still does not work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#335