Skip to content

Instantly share code, notes, and snippets.

@useafterfree
Created July 6, 2018 00:32
Show Gist options
  • Select an option

  • Save useafterfree/e27b70c6b6bc244978bf7928987f767f to your computer and use it in GitHub Desktop.

Select an option

Save useafterfree/e27b70c6b6bc244978bf7928987f767f to your computer and use it in GitHub Desktop.
This will fix DNS issues for Rancher on Ubuntu 16 and 18.
if cat /etc/lsb-release | grep -q 18; then
rm /etc/resolv.conf
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
reboot now
else
FILE=/etc/NetworkManager/NetworkManager.conf;
cat $FILE | grep dnsmasq;
sed -i 's/^dns=dnsmasq/#dns=dnsmasq/g' $FILE;
cat $FILE | grep dnsmasq;
systemctl restart NetworkManager;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment