juanfont / headscale

An open source, self-hosted implementation of the Tailscale control server
BSD 3-Clause "New" or "Revised" License
23.31k stars 1.28k forks source link

[Bug] Split DNS not working with v0.23.0 #2141

Closed maprambo closed 1 month ago

maprambo commented 1 month ago

Is this a support request?

Is there an existing issue for this?

Current Behavior

I configured split DNS. No machine can resolve the hostnames. If I manually query the dns server with dig host001.ol02.example.org @100.64.0.21 on one of my clients, it does work though.

For the new version I had to change the structure a bit in my config, but split DNS was working in before versions.

Expected Behavior

The split DNS config from headscale should be used and the tailscale DNS should automatically use the configured DNS server.

Steps To Reproduce

This is an excerpt from my config.yaml:

dns:
  split:
    ol02.example.org:
      - 100.64.0.21

Environment

- (Client) OS: iOS 16.7.10; openSUSE Tumbleweed
- Headscale version: v0.23.0
- Tailscale version: iOS client: 1.74.0; openSUSE client: 1.48.2

Runtime environment

Anything else?

I noticed the code changed - in https://github.com/juanfont/headscale/blob/41c5a0ddf56637c582098f220c06bb3180ef8799/app.go the code was

h.cfg.DNSConfig.Routes = make(map[string][]dnstype.Resolver)

Now https://github.com/juanfont/headscale/blob/main/hscontrol/app.go it is (note the *):

app.cfg.DNSConfig.Routes = make(map[string][]*dnstype.Resolver)

I have to idea if that means something.

maprambo commented 1 month ago

I figured it out. My config was wrong, note the nameservers tag:

dns:
  nameservers:
    split:
      ol02.example.org:
        - 100.64.0.21