修改?/etc/resolv.conf
?nameserver 字段
sudo vim /etc/resolv.conf
重启网络服务
sudo systemctl restart networking.service
此修改方法重启系统后会失效,/etc/resolv.conf 会恢复原本的内容
为修改后的?/etc/resolv.conf
?文件上锁
chattr +i /etc/resolv.conf
修改?/etc/dhcp/dhclient.conf
sudo vim /etc/dhcp/dhclient.conf
在文件末尾添加
supersede domain-name-servers 223.5.5.5, 223.6.6.6;
重启系统
reboot