- 检查/etc/resolv.conf是否为软链接
$ ls -lh /etc/resolv.conf
- 如果不是软链接,直接将域名服务器的地址写入/etc/resolv.conf中
$ sudo vi /etc/resolv.conf
nameserver 114.114.114.114
- 如果是软链接,那么将内容写入/etc/resolvconf/resolv.conf.d/head中
$ sudo vi /etc/resolvconf/resolv.conf.d/head
nameserver 114.114.114.114
- 更新配置
$ sudo resolvconf -u