如何恢复/重新创建etc / resolv.conf文件
假设resolvconf导致UCK失败,我错误地删除了/etc
的resolvconf
文件夹和resolv.conf
文件。 现在应用程序已升级,修复了问题,但它说no file named resolv.conf in /etc
。 它说的是正确的,因为我删除了这些文件。 有没有办法重新创建文件或从其他位置恢复?
您可以重新安装resolvconf以恢复默认配置:
sudo apt-get install --reinstall resolvconf
另一个想法是删除“resolvconf”,然后安装:
sudo apt-get remove --purge resolvconf && sudo apt-get install resolvconf
如果resolvconf -u
显示警告/etc/resolv.conf
不是/run/resolvconf/resolv.conf
的符号链接,那么只需备份resolv.conf并创建符号链接:
$ cd /etc $ sudo ln -s /run/resolvconf/resolv.conf
你有没有清空你的垃圾,如果没有,你可以从垃圾桶中恢复。
试试这个:
nano /etc/resolv.conf
加:
nameserver 8.8.8.8
nameserver 192.168.xx(检查ifconfig
输出的正确地址)
然后
sudo service resolvconf start sudo systemctl enable resolvconf
- 网络管理员:如何停止nm更新/etc/resolv.conf
- 在resolv.conf中添加名称服务器
- 如何从resolv.conf中删除localhost名称服务器
- 在Ubuntu VirtualBox中,DNS突然中断了
- resolv.conf中的nameserver 127.0.1.1不会消失!
- 如何在Ubuntu 12.04上编辑/etc/resolv.conf
- 如何在wicd中指定DNS IP?
- 在/ etc / network / interfaces中编辑dns-nameservers而不重启
- systemd-resolved,resolvconf.service,resolvconf和openresolv。 为什么,哪个以及如何?