ubuntu 13.04 重启后 resolv.conf 会被清空的问题修复

By | 2018-11-27

刚安装一台新的 ubuntu 13.04服务器,发现每次重启后 resolv.conf 会被清空,导致DNS解释出现问题!

这问题可有以下两种方法修复:

1) 在网卡配置文件上配置 DNS ,修改 /etc/network/interface

             iface eth0 inet static
             address 192.168.3.3
             netmask 255.255.255.0
             gateway 192.168.3.1
         dns-nameservers 8.8.8.8 8.8.4.4

       2)修改 resolvconf服务的配置文件: /etc/resolvconf/resolv.conf.d/base
加入 nameserver 8.8.8.8  这一行

最后重启一下服务器,以后就不会再清空了!

發佈留言