From adad20b6a14cc43661f69463adc66f0ef09dfc00 Mon Sep 17 00:00:00 2001 From: Jarek <65668659+jardahrazdera@users.noreply.github.com> Date: Mon, 13 Oct 2025 01:59:04 +0200 Subject: [PATCH] Fix Tailscale split DNS compatibility by removing [!UNAVAIL=return] (#1884) Removes [!UNAVAIL=return] from nsswitch.conf configuration to resolve Tailscale split DNS issues while maintaining mDNS printer discovery. - Updated printer setup script - Updated existing Avahi migration - Added migration for existing users Addresses: https://github.com/basecamp/omarchy/pull/1021#issuecomment-3318650490 --- install/config/hardware/printer.sh | 2 +- migrations/1757361128.sh | 2 +- migrations/1758562032.sh | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 migrations/1758562032.sh diff --git a/install/config/hardware/printer.sh b/install/config/hardware/printer.sh index 781a9871..244368e6 100644 --- a/install/config/hardware/printer.sh +++ b/install/config/hardware/printer.sh @@ -6,7 +6,7 @@ echo -e "[Resolve]\nMulticastDNS=no" | sudo tee /etc/systemd/resolved.conf.d/10- chrootable_systemctl_enable avahi-daemon.service # Enable mDNS resolution for .local domains -sudo sed -i 's/^hosts:.*/hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns/' /etc/nsswitch.conf +sudo sed -i 's/^hosts:.*/hosts: mymachines mdns_minimal [NOTFOUND=return] resolve files myhostname dns/' /etc/nsswitch.conf # Enable automatically adding remote printers if ! grep -q '^CreateRemotePrinters Yes' /etc/cups/cups-browsed.conf; then diff --git a/migrations/1757361128.sh b/migrations/1757361128.sh index b6c8413e..0bd0b407 100644 --- a/migrations/1757361128.sh +++ b/migrations/1757361128.sh @@ -2,6 +2,6 @@ echo "Enable mDNS resolution for existing Avahi installations" if systemctl is-enabled avahi-daemon.service >/dev/null 2>&1; then if ! grep -q "mdns_minimal" /etc/nsswitch.conf; then - sudo sed -i 's/^hosts:.*/hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns/' /etc/nsswitch.conf + sudo sed -i 's/^hosts:.*/hosts: mymachines mdns_minimal [NOTFOUND=return] resolve files myhostname dns/' /etc/nsswitch.conf fi fi \ No newline at end of file diff --git a/migrations/1758562032.sh b/migrations/1758562032.sh new file mode 100644 index 00000000..5c4c357e --- /dev/null +++ b/migrations/1758562032.sh @@ -0,0 +1,5 @@ +echo "Fix Tailscale split DNS compatibility by removing [!UNAVAIL=return] from nsswitch.conf" + +if grep -q '\[!UNAVAIL=return\]' /etc/nsswitch.conf; then + sudo sed -i 's/resolve \[!UNAVAIL=return\]/resolve/g' /etc/nsswitch.conf +fi \ No newline at end of file