Welcome 微信登录

首页 / 操作系统 / Linux / Ubuntu修改DNS重启丢失问题

Ubuntu 15.04直接修改/etc/resolv.conf,添加DNS重启后配置丢失。正确方法:
  1. #vim /etc/network/interfaces,文件最后添加“dns-nameservers  223.5.5.5”重启systemctl restart networking.service,测试OK
  2. #vim /etc/resolvconf/resolv.conf.d/base(文件默认为空)nameserver  223.5.5.5nameserver  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 OVERWRITTENnameserver 223.5.5.5nameserver 223.6.6.6不需要重启网卡/系统,测试OK,重启系统后OK。
更多Ubuntu相关信息见Ubuntu 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=2本文永久更新链接地址