Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using a proxy to connect to internet. I can use firefox and software center. but can not ping google. when I try it says

ping google.com

ping: unknown host google.com

I have tried with ip address also. it says Destination Host Unreachable.

please help. Thanks in advance.

share|improve this question
    
That doesn't matter in this case... –  the_Seppi Mar 2 at 15:44
    
yes, You are right. I found that I am also suffering from same problem. –  Guru Mar 2 at 15:46
    
If you're accessing through proxy.. then have you tried applying proxy system wide under network... :) –  AzkerM Mar 2 at 15:50
    
Little strange problem. I can ping when I am connected using ppp interface but can't when using my samsung wave mobile wifi hotspot. –  Guru Mar 2 at 15:55
    
I guess the phone accesses the internet via 3G etc. so you don't need the proxy there –  the_Seppi Mar 3 at 17:04

1 Answer 1

up vote 1 down vote accepted

For bash commands you have to set the proxy seperately. For this, you have to set a environment variable, e.g.:

ping google.com    # can't resolve, no proxy set
export http_proxy=proxy.example.com:1234
ping google.com    # works, proxy set for this bash session.

Replace the address and the port with your proxy configuration. If you're always behind this proxy, add the export http_proxy... command to ~/.bashrc so it gets executed every time you start a new bash session.

Or to execute a single command with proxy settings and without setting environment variables, use env, e.g.:

env http_proxy=proxy.example.com:1234 ping google.com
sudo env http_proxy=proxy.example.com:1234 apt-get install cowsay

To use other services, e.g. HTTPS or FTP you have to set different variables:

export https_proxy=proxy.example.com:1234
export ftp_proxy=proxy.example.com:1234
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.