终端没有互联网 [英] No internet in terminal

查看:58
本文介绍了终端没有互联网的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

网络上到处都是类似的问题,但是我咨询了他们也没有解决我的问题:(

Similar questions to this one are all over the net, but I failed to solve my problem even after consulting them :(

我正在 kubuntu 14.04 笔记本电脑上尝试 sudo apt-get update,我得到了大量 W:无法获取 http://..... (-5 - 没有与主机名关联的地址) 消息

I am trying sudo apt-get update on a kubuntu 14.04 laptop, and I get a ton of W: Failed to fetch http://... Something wicked happened resolving ... (-5 - No address associated with hostname) messages

另外,ping google.com 给出 ping: unknown host google.com

但是我可以通过 Firefox 连接到 Internet...

I can however connect to the Internet through Firefox...

可能与代理问题有关

我看到了添加诸如 export http_proxy=http://username:pass@proxy_url:port/.bashrc 之类的语句的建议,但我不知道是什么我的 proxy_url 完全正确.

I saw suggestions to add statements like export http_proxy=http://username:pass@proxy_url:port/ to .bashrc but I don't know what is my proxy_url exactly.

查看这个网站 http://aruljohn.com/details.php ,我可以看到我的端口号码,但我在 Proxy server

Checking this website http://aruljohn.com/details.php , I can see my port number but I have Not available next to Proxy server

请帮忙!

推荐答案

这个好像跟dns服务有关.查看/etc/resolv.conf的内容

This seems to be related with dns service. Check content of /etc/resolv.conf

在这个文件中你应该有类似

In this file you should have something like

nameserver xxx.yy.zz.www
nameserver xxx.yy.zz.www

如果你没有任何以 nameserver 开头的行,你应该在那里添加一些.使用您的提供商提供给您的地址或使用一些公共地址,例如 Google dns 8.8.8.8.

If you don't have any lines beginning with nameserver, you should add some there. Use address your provider gave you or use some public, for example Google dns 8.8.8.8.

如果您在这里有一些条目,请尝试 ping 它们.如果他们没有响应,请在第一行添加 Google dns 服务器

If you have some entries here, try ping them. If they are not responding add Google dns server on the first line

nameserver 8.8.8.8

如果您使用 DHCP,服务器应该为您提供名称服务器列表,并且您的 resolv.conf 文件应该没问题.如果不是,请联系您的 DHCP 服务器管理员.

If you are using DHCP, server should provide you nameservers list and your resolv.conf file should be okay. If it is not, contact your DHCP server administrator.

这篇关于终端没有互联网的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆