linux - ubuntu 中未知主机连接到互联网

标签 linux

我尝试连接到我的 WiFi 网络,但无法通过我的笔记本电脑连接。我家里的其他设备能够连接到互联网。我正在使用 ubuntu 16.04 LTS 。我将浏览器代理设置为 no proxy 。我没有安装防病毒软件。 我尝试在终端中 ping -c 5 (google .com 和 facebook.com),显示未知主机 google.com 和未知主机 facebook.com 并尝试安装 eclipse,同时下载它显示错误 java error Unknown Host 。 请帮我解决这个问题。

最佳答案

听起来您连接到网络时可能尚未配置 DNS。这通常应该自动发生,但您可以通过查看文件 /etc/resolv.conf 进行检查。文件中至少应有一行包含 nameserver 和 IP 地址。

如果没有 nameserver 行,或者只有一个且显示 nameserver 127.0.0.1,那么您可以通过添加 nameserver 8.8.8.8 行(如果存在 127.0.0.1,请替换它)来尝试使用 Google 的公共(public) DNS。

关于linux - ubuntu 中未知主机连接到互联网,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39061353/

相关文章:

linux - Ansible - 未安装 winrm 或请求

c - 如何在Linux中覆盖控制台输出

linux - "diff"可以在指定点强制同步吗?

python - 在 linux 上为非默认版本安装 python 模块

linux - 在 linux 邮件服务器上查找邮件消息

linux - 在 Linux 中 : How to repeat multiple lines in a file in the same order?

c - 没有这样的文件或目录打开系统调用错误

linux - strace应该如何使用?

linux - 零填充和排序 - Linux Shell 脚本

c - C 中的 fork 和 waitpid