- return nil, errors.New("server_url cannot contain the base_domain, this will cause the headscale server and embedded DERP to become unreachable from the Tailscale node.")
+ if !dnsConfig.UserNameInMagicDNS && dnsConfig.BaseDomain != "" {
+ if err := isSafeServerURL(serverURL, dnsConfig.BaseDomain); err != nil {
- wantErr: "server_url cannot contain the base_domain, this will cause the headscale server and embedded DERP to become unreachable from the Tailscale node.",