經過修改:server
sudo vi /etc/resolvconf/resolv.conf.d/base(這個文件默認是空的)域名
在裏面插入:
nameserver 8.8.8.8
nameserver 8.8.4.4file
若是有多個DNS就一行一個文件
修改好保存,而後執行ping
sudo resolvconf -uvi
再看/etc/resolv.conf,最下面就多了2行:co
cat /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 8.8.8.8
nameserver 8.8.4.4sudo
能夠看到咱們的設置已經加上了,而後再ping一個域名,當時就能夠解析了,無需重啓。vc