No internet in terminal

谁说胖子不能爱 提交于 2019-12-11 11:35:08

问题


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

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

Also, ping google.com gives ping: unknown host google.com

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

It is probably related to some proxy issue

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.

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

Please Help!


回答1:


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

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.

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

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.



来源:https://stackoverflow.com/questions/27502921/no-internet-in-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!