mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-31 04:04:45 +00:00
tailscale: fix broken DNS on IPv6 only tailnets
When a tailnet has the disableIPv4 settings it will not deploy IPv4, resolving any ts.net address is broken because 100.100.100.100 is not reachable. https://tailscale.com/kb/1337/acl-syntax#disableipv4 Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com> Co-authored-by: Sam <30577766+Samasaur1@users.noreply.github.com>
This commit is contained in:
parent
bb81755a36
commit
801e0cb2e9
1 changed files with 7 additions and 4 deletions
|
@ -33,7 +33,7 @@ in
|
|||
1. at least one DNS server is added
|
||||
2. `Override local DNS` is enabled
|
||||
|
||||
As this option sets 100.100.100.100 as your sole DNS server, if the requirements above are not met,
|
||||
As this option sets 100.100.100.100 and fd7a:115c:a1e0::53 as your sole DNS servers, if the requirements above are not met,
|
||||
all non-MagicDNS queries WILL fail.
|
||||
'';
|
||||
};
|
||||
|
@ -41,7 +41,7 @@ in
|
|||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [{
|
||||
assertion = !cfg.overrideLocalDns || config.networking.dns == [ "100.100.100.100" ];
|
||||
assertion = cfg.overrideLocalDns -> (builtins.any (x: x != "100.100.100.100" || x != "fd7a:115c:a1e0::53") config.networking.dns);
|
||||
message = ''
|
||||
DNS servers should be configured on the Tailscale control panel when `services.tailscale.overrideLocalDns` is enabled.
|
||||
|
||||
|
@ -61,10 +61,13 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
networking.dns = mkIf cfg.overrideLocalDns [ "100.100.100.100" ];
|
||||
networking.dns = mkIf cfg.overrideLocalDns [ "100.100.100.100" "fd7a:115c:a1e0::53" ];
|
||||
|
||||
# Ensures Tailscale MagicDNS always works even without adding 100.100.100.100 to DNS servers
|
||||
environment.etc."resolver/ts.net".text = "nameserver 100.100.100.100";
|
||||
environment.etc."resolver/ts.net".text = ''
|
||||
nameserver 100.100.100.100
|
||||
nameserver fd7a:115c:a1e0::53
|
||||
'';
|
||||
|
||||
# This file gets created by tailscaled when `Override local DNS` is turned off
|
||||
environment.etc."resolver/ts.net".knownSha256Hashes = [
|
||||
|
|
Loading…
Add table
Reference in a new issue