ubuntu18.04下dns如何设置?

  1. 检查/etc/resolv.conf是否为软链接
$ ls -lh /etc/resolv.conf
  1. 如果不是软链接,直接将域名服务器的地址写入/etc/resolv.conf中
$ sudo vi /etc/resolv.conf
nameserver 114.114.114.114
  1. 如果是软链接,那么将内容写入/etc/resolvconf/resolv.conf.d/head中
$ sudo vi /etc/resolvconf/resolv.conf.d/head
nameserver 114.114.114.114
  1. 更新配置
$ sudo resolvconf -u
posted @ 2020-06-23 11:03  Jello  阅读(628)  评论(0编辑  收藏  举报