Ubuntu 修改 DNS
永久修改 DNS临时修改 DNS
永久修改 DNS
修改 resolved.conf 文件$ sudo vim /etc/systemd/resolved.conf
修改 DNS 项[Resolve]DNS=114.114.114.114DNS=8.8.8.8#FallbackDNS=#Domains=#LLMNR=no#MulticastDNS=no#DNSSEC=no#Cache=yes#DNSStubListener=yes
重启 systemd-resolved 服务$ sudo systemctl restart systemd-resolved
设置开机启动 systemd-resolved 服务$ sudo systemctl enable systemd-resolved
备份 systemd-resolved 托管文件 resolv.conf$ sudo mv /etc/resolv.conf /etc/resolv.conf.bak
重新生成。$ sudo ln -s /run/systemd/resolve/resolv.conf /etc/
临时修改 DNS
修改 resolv.conf 文件$ sudo vim /etc/resolv.conf
修改 DNS 项nameserver 8.8.8.8