Ubuntu 12.04重启后resolv.conf清空的问题

1、 /etc/resolv.conf 其实是一个Link

它其实指向的是 /run/resolvconf/resolv.conf

2 、Ubuntu 有一个 resolvconf 服务,如果重启它,那么 /etc/resolv.conf 的内容会被修改成默认的样子

所以 不能直接修改 /etc/resolv.conf

3、 如果想自己定义 nameserver,那么有以下2个办法:

A、 在网卡的配置文件里面加:

iface eth0 inet static
address 192.168.3.3
netmask 255.255.255.0
gateway 192.168.3.1
dns-nameservers 192.168.3.45 192.168.8.10
dns-search foo.org bar.com

B、 修改 resolvconf服务的配置文件: /etc/resolvconf/resolv.conf.d/base

你可能感兴趣的:(ubuntu)