From 59c70fdd46f76906fa15650b5f1dbb7511f8cd0c Mon Sep 17 00:00:00 2001 From: Jarek <65668659+jardahrazdera@users.noreply.github.com> Date: Sat, 30 Aug 2025 09:41:14 +0200 Subject: [PATCH] Fix DNS migration to handle UseDNS=no in network files (#1314) * Fix DNS migration to handle UseDNS=no in network files Issue #1246: Migration 1755109182.sh only fixes resolved.conf but doesn't remove UseDNS=no from network files. When UseDNS=no persists, it blocks DHCP DNS and forces fallback to Cloudflare after reboot. Fix: Remove UseDNS=no from all network files, matching omarchy-setup-dns DHCP behavior. * Add new migration 1756491748.sh for existing users Fixes DNS issue for users who already ran migration 1755109182.sh. Removes UseDNS=no from network files to enable DHCP DNS. * Apply requested changes - Revert 1755109182.sh to original state - Consolidate all fixes in new migration 1756491748.sh - Follow migration style guidelines --- migrations/1755109182.sh | 3 +-- migrations/1756491748.sh | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100755 migrations/1756491748.sh diff --git a/migrations/1755109182.sh b/migrations/1755109182.sh index 352e342..1908b94 100755 --- a/migrations/1755109182.sh +++ b/migrations/1755109182.sh @@ -28,5 +28,4 @@ if [ -f /etc/systemd/resolved.conf ]; then echo "DNS configuration reset to use DHCP (router DNS)" echo "To use Cloudflare DNS, run: omarchy-setup-dns Cloudflare" -fi - +fi \ No newline at end of file diff --git a/migrations/1756491748.sh b/migrations/1756491748.sh new file mode 100755 index 0000000..801f82a --- /dev/null +++ b/migrations/1756491748.sh @@ -0,0 +1,6 @@ +echo "Removing UseDNS=no from network files to fix DNS issue" + +for file in /etc/systemd/network/*.network; do + [[ -f "$file" ]] || continue + sudo sed -i '/^UseDNS=no/d' "$file" +done \ No newline at end of file