When I change a wifi or reboot the machine, it will occur DNS resolution error result in connecting to the Network failed. I have tried to change /etc/resolv.conf
file,but it was useless. The reason why is that the NetworkManager will change it and override it automatically which makes me crazy.
Solution
sudo vim /etc/resolv.conf
Change the DNS server you want.
After save and quit, you also need to run this command to make sure that it can't be changed.sudo chattr +i /etc/resolv.conf
每次切换wifi,重启 都会出现DNS解析问题。通过手动修改/etc/resolv.conf 中的nameserver 没用,NetWorkManager会重新生成该文件并覆盖它。这是最他妈卖批骚的。
解决办法
sudo vim /etc/resolv.conf
在里面添加要改的DNS服务器
修改完后加上 sudo chattr +i /etc/resolv.conf 这条命令