Ubuntu修改DNS重启丢失问题
Ubuntu 15.04直接修改/etc/resolv.conf,添加DNS重启后配置丢失。
正确方法:
#vim /etc/network/interfaces,文件最后添加“dns-nameservers 223.5.5.5”
重启systemctl restart networking.service,测试OK
#vim /etc/resolvconf/resolv.conf.d/base(文件默认为空)
nameserver 223.5.5.5
nameserver 223.6.6.6
#resolvconf -u (更新改动至resolv.conf)
#more /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
nameserver 223.5.5.5
nameserver 223.6.6.6
不需要重启网卡/系统,测试OK,重启系统后OK。
相关推荐
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
windzoone 2020-07-29
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
chwzmx 2020-06-09