Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 49321  / 2 Years ago, sat, december 11, 2021, 8:55:57

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.


More From » ping

 Answers
1

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

[#26728] Sunday, December 12, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bathtusain

Total Points: 380
Total Questions: 124
Total Answers: 111

Location: Trinidad and Tobago
Member since Sat, Apr 9, 2022
2 Years ago
bathtusain questions
Sun, Jul 17, 22, 03:13, 2 Years ago
Sun, Oct 3, 21, 00:24, 3 Years ago
Sat, Apr 22, 23, 00:24, 1 Year ago
Fri, Jul 22, 22, 12:01, 2 Years ago
Sun, Jun 27, 21, 02:31, 3 Years ago
;