[Bug] Search domains don't consistently populate when restarting tailscale #1179

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

Originally created by @rittycat on GitHub (Dec 18, 2025).

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

When freshly joining headscale (and sometimes when restarting), the search domains are correctly added, making magic DNS work. However, using systemctl restart tailscaled replaces the search domains with tailscale's default.

I'm not actually sure how to reset this without deleting the node and rejoining it. Even changing the magic DNS domain, or turning the feature off and on again doesn't appear to help.

Expected Behavior

I expect the search domains to always be updated and correct.

Tailscale SaaS doesn't seem to have the issue since the official search domain appears to be populated by default all the time. My suspicion is that Headscale needs to explicitly prompt the client to update the DNS every time a reconnect event happens?

Steps To Reproduce

  1. Connect a linux host to headscale
  2. Verify search domain is in /etc/resolv.conf
  3. Restart tailscaled
  4. The search domain is now gone

Environment

- OS: Ubuntu 24.04.3 LTS - 6.8.0-71-generic Kernel
- Headscale version: V0.27.1
    headscale version v0.27.1+dirty
    commit: f658a8eacd4d86edc65424b50635afed46ca4b2a
    build time: 2025-11-11T19:17:02Z
    built with: go1.25.1 linux/amd64
- Tailscale version:  1.92.1
    tailscale commit: fb55d39055de6bb41a76cefebc923f2a7fe3dfec
    long version: 1.92.1-tfb55d3905-g9ac7fadc0
    other commit: 9ac7fadc0bb77ed38a4c7ca463af06e21002bbdb
    go version: go1.25.5

Using systemd-resolved: `/etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf`

Runtime environment

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

Debug information

Before Restart:

/etc/resolv.conf: search ts.mydomain.dev tailde9bf.ts.net

tailscale dns status output

=== 'Use Tailscale DNS' status ===

Tailscale DNS: enabled.

Tailscale is configured to handle DNS queries on this device.
Run 'tailscale set --accept-dns=false' to revert to your system default DNS resolver.

=== MagicDNS configuration ===

This is the DNS configuration provided by the coordination server to this device.

MagicDNS: enabled tailnet-wide (suffix = ts.mydomain.dev)

Other devices in your tailnet can reach this device at node03.ts.mydomain.dev.

Resolvers (in preference order):
  - 1.1.1.1
  - 8.8.8.8

Split DNS Routes:

Search Domains:
  - ts.mydomain.dev

=== System DNS configuration ===

This is the DNS configuration that Tailscale believes your operating system is using.
Tailscale may use this configuration if 'Override Local DNS' is disabled in the admin console,
or if no resolvers are provided by the coordination server.

  (reading the system DNS configuration is not supported on this platform)

[this is a preliminary version of this command; the output format may change in the future]

After Restart:

/etc/resolv.conf: search tailde9bf.ts.net

tailscale dns status output

=== 'Use Tailscale DNS' status ===

Tailscale DNS: enabled.

Tailscale is configured to handle DNS queries on this device.
Run 'tailscale set --accept-dns=false' to revert to your system default DNS resolver.

=== MagicDNS configuration ===

This is the DNS configuration provided by the coordination server to this device.

MagicDNS: enabled tailnet-wide (suffix = ts.mydomain.dev)

Other devices in your tailnet can reach this device at node03.ts.mydomain.dev.

Resolvers (in preference order):
  - 1.1.1.1
  - 8.8.8.8

Split DNS Routes:

Search Domains:
  - ts.mydomain.dev

=== System DNS configuration ===

This is the DNS configuration that Tailscale believes your operating system is using.
Tailscale may use this configuration if 'Override Local DNS' is disabled in the admin console,
or if no resolvers are provided by the coordination server.

  (reading the system DNS configuration is not supported on this platform)

[this is a preliminary version of this command; the output format may change in the future]

Everything seems to look the same from the dns status, so I'm not sure what the deal is.

Originally created by @rittycat on GitHub (Dec 18, 2025). ### 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 When freshly joining headscale (and sometimes when restarting), the search domains are correctly added, making magic DNS work. However, using `systemctl restart tailscaled` replaces the search domains with tailscale's default. I'm not actually sure how to reset this without deleting the node and rejoining it. Even changing the magic DNS domain, or turning the feature off and on again doesn't appear to help. ### Expected Behavior I expect the search domains to always be updated and correct. Tailscale SaaS doesn't seem to have the issue since the official search domain appears to be populated by default all the time. My suspicion is that Headscale needs to explicitly prompt the client to update the DNS every time a reconnect event happens? ### Steps To Reproduce 1. Connect a linux host to headscale 2. Verify search domain is in /etc/resolv.conf 3. Restart tailscaled 4. The search domain is now gone ### Environment ```markdown - OS: Ubuntu 24.04.3 LTS - 6.8.0-71-generic Kernel - Headscale version: V0.27.1 headscale version v0.27.1+dirty commit: f658a8eacd4d86edc65424b50635afed46ca4b2a build time: 2025-11-11T19:17:02Z built with: go1.25.1 linux/amd64 - Tailscale version: 1.92.1 tailscale commit: fb55d39055de6bb41a76cefebc923f2a7fe3dfec long version: 1.92.1-tfb55d3905-g9ac7fadc0 other commit: 9ac7fadc0bb77ed38a4c7ca463af06e21002bbdb go version: go1.25.5 Using systemd-resolved: `/etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf` ``` ### Runtime environment - [x] Headscale is behind a (reverse) proxy - [x] Headscale runs in a container ### Debug information ## Before Restart: /etc/resolv.conf: `search ts.mydomain.dev tailde9bf.ts.net` tailscale dns status output ``` === 'Use Tailscale DNS' status === Tailscale DNS: enabled. Tailscale is configured to handle DNS queries on this device. Run 'tailscale set --accept-dns=false' to revert to your system default DNS resolver. === MagicDNS configuration === This is the DNS configuration provided by the coordination server to this device. MagicDNS: enabled tailnet-wide (suffix = ts.mydomain.dev) Other devices in your tailnet can reach this device at node03.ts.mydomain.dev. Resolvers (in preference order): - 1.1.1.1 - 8.8.8.8 Split DNS Routes: Search Domains: - ts.mydomain.dev === System DNS configuration === This is the DNS configuration that Tailscale believes your operating system is using. Tailscale may use this configuration if 'Override Local DNS' is disabled in the admin console, or if no resolvers are provided by the coordination server. (reading the system DNS configuration is not supported on this platform) [this is a preliminary version of this command; the output format may change in the future] ``` ## After Restart: /etc/resolv.conf: `search tailde9bf.ts.net` tailscale dns status output ``` === 'Use Tailscale DNS' status === Tailscale DNS: enabled. Tailscale is configured to handle DNS queries on this device. Run 'tailscale set --accept-dns=false' to revert to your system default DNS resolver. === MagicDNS configuration === This is the DNS configuration provided by the coordination server to this device. MagicDNS: enabled tailnet-wide (suffix = ts.mydomain.dev) Other devices in your tailnet can reach this device at node03.ts.mydomain.dev. Resolvers (in preference order): - 1.1.1.1 - 8.8.8.8 Split DNS Routes: Search Domains: - ts.mydomain.dev === System DNS configuration === This is the DNS configuration that Tailscale believes your operating system is using. Tailscale may use this configuration if 'Override Local DNS' is disabled in the admin console, or if no resolvers are provided by the coordination server. (reading the system DNS configuration is not supported on this platform) [this is a preliminary version of this command; the output format may change in the future] ``` Everything seems to look the same from the dns status, so I'm not sure what the deal is.
adam added the bug label 2025-12-29 02:28:44 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1179