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
:/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
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
相关推荐
windzoone 2020-07-29
chwzmx 2020-05-30
localhost0 2020-11-12
jlccwss 2020-09-11
lwplvx 2020-09-07
YzhilongY 2020-08-31
KevinXC 2020-08-12
oLeiShen 2020-08-01
dahege 2020-08-01
travelinrain 2020-07-27
hxf0 2020-07-10
oLeiShen 2020-06-25
oLeiShen 2020-06-25
dahege 2020-06-25
dahege 2020-06-22
MissFuTT 2020-06-21
ationwork 2020-06-16
kenson 2020-06-12