linux修改dns
linux修改dns
ifconfig -a
一般来说,eth0就是第一块网卡了,而lo是localhost的缩写。
然后编辑 /etc/network/interfaces 添加下面的信息
1 | auto eth0 // 开机自动挂载这张网卡 |
如果使用DHCP,将”iface eth0 inte static”改为”iface eth0 inet dhcp”
配置DNS服务器
编辑/etc/resolv.conf
nameserver 114.114.114.114
然后重启机器或者重启网卡,附上重启网卡的指令:
/etc/init.d/networking restart