解决方法:
请etc/resolvconf/resolv.conf.d这个目录下,添加一个文件,文件填写你相对应的网络的DNS的配置,如电信的网络,则添加nameserve 202.96.134.133
root@galen:/etc/resolvconf/resolv.conf.d# cat tail
nameserver 202.96.134.133
nameserver 202.96.128.68
使用:wq!保存一下。
最后你尝试进行 apt-get update(根用户下),会出现以下现象:
Hit http://security.ubuntu.com precise-security/universe Sources
Hit http://security.ubuntu.com precise-security/multiverse Sources
Hit http://security.ubuntu.com precise-security/main i386 Packages
Hit http://security.ubuntu.com precise-security/restricted i386 Packages
Hit http://security.ubuntu.com precise-security/universe i386 Packages
Hit http://security.ubuntu.com precise-security/multiverse i386 Packages
Hit http://security.ubuntu.com precise-security/main TranslationIndex
Hit http://security.ubuntu.com precise-security/multiverse TranslationIndex
Hit http://security.ubuntu.com precise-security/restricted TranslationIndex
Hit http://extras.ubuntu.com precise/main Sources
Hit http://security.ubuntu.com precise-security/universe TranslationIndex
Hit http://security.ubuntu.com precise-security/main Translation-en
Hit http://security.ubuntu.com precise-security/multiverse Translation-en
Hit http://extras.ubuntu.com precise/main i386 Packages
Ign http://extras.ubuntu.com precise/main TranslationIndex
Hit http://security.ubuntu.com precise-security/restricted Translation-en
Hit http://security.ubuntu.com precise-security/universe Translation-en
Ign http://extras.ubuntu.com precise/main Translation-en_US
Ign http://extras.ubuntu.com precise/main Translation-en
Fetched 72 B in 7s (9 B/s)
Reading package lists... Done
root@galen:~#
到了这步,恭喜你,DNS的配置重启丢失问题已解决了。
注意:你不能在直接进行以下的操作:
root@galen:~# 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
nameserver 202.96.134.133
nameserver 202.96.128.68