systemd-resolved can cause issues with Kubernetes (not to mention the time spent troubleshooting various issues).

Fix

  • Disable the systemd-resolved service
sudo systemctl disable systemd-resolved
sudo systemctl stop systemd-resolved
  • Remove the remove the existing /etc/resolv.conf file, which is currently a symbolic link to /run/systemd/resolve/stub-resolv.conf
sudo rm /etc/resolv.conf
  • Create a new static resolv.conf
echo 'search example.com' > /etc/resolv.conf
echo 'nameserver 1.1.1.1' >> /etc/resolv.conf
echo 'nameserver 1.0.0.1' >> /etc/resolv.conf

References