Use host's DNS resolver in Docker containers (#812)

* Symlink /etc/resolve.conf to systemd-resolved's stub

Since systemd-resolved is managing the DNS configuration, ensure that
/etc/resolv.conf uses it.

* Use systemd-resolved from Docker containers
This commit is contained in:
Kevin McConnell
2025-08-15 14:29:25 +01:00
committed by GitHub
parent 2db5e730a7
commit aca23ad834
4 changed files with 42 additions and 2 deletions

View File

@@ -29,6 +29,9 @@ sudo sed -i 's|^\(auth\s\+\[default=die\]\s\+pam_faillock.so\)\s\+authfail.*$|\1
# Set Cloudflare as primary DNS (with Google as backup)
sudo cp ~/.local/share/omarchy/default/systemd/resolved.conf /etc/systemd/
# Ensure /etc/resolv.conf is symlinked to systemd-resolved's stub resolver
sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
# Solve common flakiness with SSH
echo "net.ipv4.tcp_mtu_probing=1" | sudo tee -a /etc/sysctl.d/99-sysctl.conf