[Bug] dns_config.domains only works if override_local_dns is enabled #719

Closed
opened 2025-12-29 02:22:49 +01:00 by adam · 3 comments
Owner

Originally created by @ajs124 on GitHub (May 31, 2024).

Is this a support request?

  • This is not a support request

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Setting dns_config.domains without setting dns_config.override_local_dns = true leads to this warning and dns_config.domains being not applied:
Warning: dns_config.domains is set, but no nameservers are configured. Ignoring domains. (https://github.com/juanfont/headscale/blob/main/hscontrol/types/config.go#L545)

This warning is quite misleading, because nameservers actually refers to resolvers, which is taken from the nameservers field, but only if override_local_dns = true (https://github.com/juanfont/headscale/blob/main/hscontrol/types/config.go#L503).

Expected Behavior

If there are technical reasons, keep this behavior and emit a less misleading error message.

If there aren't any technical reasons for why domains needs override_local_dns, change the check and apply this config.

Steps To Reproduce

Set domains to a non-empty list while setting override_local_dns to false.

Environment

- OS: NixOS 24.05
- Headscale version: master, e.g. 5f9c26930ce796284a8fc7ad167f76e187813d64
- Tailscale version: 1.66.4

Runtime environment

  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

Anything else?

I'm open to implementing either option (better error message or changing the check) and opening a PR, if you want me to.

Originally created by @ajs124 on GitHub (May 31, 2024). ### Is this a support request? - [X] This is not a support request ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current Behavior Setting `dns_config.domains` without setting `dns_config.override_local_dns = true` leads to this warning and `dns_config.domains` being not applied: `Warning: dns_config.domains is set, but no nameservers are configured. Ignoring domains.` (https://github.com/juanfont/headscale/blob/main/hscontrol/types/config.go#L545) This warning is quite misleading, because `nameservers` actually refers to `resolvers`, which is taken from the `nameservers` field, but only if `override_local_dns = true` (https://github.com/juanfont/headscale/blob/main/hscontrol/types/config.go#L503). ### Expected Behavior If there are technical reasons, keep this behavior and emit a less misleading error message. If there aren't any technical reasons for why `domains` needs `override_local_dns`, change the check and apply this config. ### Steps To Reproduce Set `domains` to a non-empty list while setting `override_local_dns` to `false`. ### Environment ```markdown - OS: NixOS 24.05 - Headscale version: master, e.g. 5f9c26930ce796284a8fc7ad167f76e187813d64 - Tailscale version: 1.66.4 ``` ### Runtime environment - [X] Headscale is behind a (reverse) proxy - [ ] Headscale runs in a container ### Anything else? I'm open to implementing either option (better error message or changing the check) and opening a PR, if you want me to.
adam added the bug label 2025-12-29 02:22:49 +01:00
adam closed this issue 2025-12-29 02:22:49 +01:00
Author
Owner

@kradalby commented on GitHub (Jun 20, 2024):

I think this is a longstanding bug, I dont think the error makes sense based on Tailscales docs, can you give https://github.com/juanfont/headscale/pull/1987 a go?

@kradalby commented on GitHub (Jun 20, 2024): I think this is a longstanding bug, I dont think the error makes sense based on Tailscales docs, can you give https://github.com/juanfont/headscale/pull/1987 a go?
Author
Owner

@ajs124 commented on GitHub (Jun 21, 2024):

Thanks! I will give that PR a go, but it might take some days/weeks.

@ajs124 commented on GitHub (Jun 21, 2024): Thanks! I will give that PR a go, but it might take some days/weeks.
Author
Owner

@ajs124 commented on GitHub (Jun 23, 2024):

I gave it a try and it seems to solve my problem. Didn't do any extensive tests though.

@ajs124 commented on GitHub (Jun 23, 2024): I gave it a try and it seems to solve my problem. Didn't do any extensive tests though.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#719