`
eimhee
  • 浏览: 2113804 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

ubuntu dns设置

阅读更多

我用的是Ubuntu 14.04.2 LTS, 最近发现一重启ubuntu, 就访问不了任何网站, 发现是重启后dns 重置了,

 

写道
vi /etc/resolv.conf


:/etc$ vi /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

 

resolv.conf自动被重置了。

 

有2个方法修改这个问题,

 

第一个方法是修改/etc/network/interfaces

写道
iface eth0 inet static
address 192.168.3.3
netmask 255.255.255.0
gateway 192.168.3.1
dns-search example.com
dns-nameservers 192.168.3.45 192.168.8.10

 

第二个方法是修改 /etc/resolvconf/resolv.conf.d/base

 

编辑加入下面这一行

 

写道

 

nameserver 8.8.8.8

 然后重新产生resolv.conf

 

写道

 

sudo resolvconf -u

 

 

3
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics