通过编辑 vi /etc/resolv.conf 设置首选DNS和次要DNS。如下,排在前面的就是首选DNS,后面一行就是次要的DNS服务器DNS
vi /etc/resolv.conf nameserver 223.5.5.5 nameserver 223.6.6.6
检查配置是否生效:
#nslookup www.baidu.com Server: 223.5.5.5 Address: 223.5.5.5#53 Non-authoritative answer: www.baidu.com canonical name = www.a.shifen.com. Name: www.a.shifen.com Address: 61.135.169.125 Name: www.a.shifen.com Address: 61.135.169.121