Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I am behind a proxy server in my college. It uses a simple username and password authentication. And i connect to the proxy server to port 3128. now i want to telnet simply to say any website on the internet like

$ telnet 80

this gives me

error telnet: could not resolve Name or service not known

How can I define the proxy settings for telnet? I have already set environment variables http_proxy and HTTP_PROXY. Also have applied system wide proxy.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You can use Proxychains for this.

First install proxychains, using the command:

$ apt-get install proxychains

Then configure your proxy settings in /etc/proxychains.conf file.

Add at last, these lines for HTTP and HTTPS proxy.

http    proxy-ip   proxy-port    username        password
https   proxy-ip   proxy-port    username        password

Now you can do telnet by using the following command:

$ proxychains telnet 80
share|improve this answer
i am getting this error: aakash@sigdel:~$ proxychains telnet 3128ProxyChains-3.1 ( |DNS-response|: sigdel is not exist |DNS-request| |S-chain|-<>-<--timeout |DNS-response|: is not exist telnet: could not resolve Unknown error –  Aakash Sigdel Apr 23 '12 at 2:21
@AakashSigdel: Sorry, the last command which I wrote should be $ proxychains telnet 80. It should work now !! –  pradeepchhetri Apr 23 '12 at 3:37
@pradeepchhetri i got error when i use this proxychains telnet 80 ProxyChains-3.1 ( |DNS-response|: xyz does not exist |DNS-request| |S-chain|-<>-proxy-ip:proxy-port-<><>-<--denied |DNS-response|: does not exist telnet: could not resolve Unknown error –  john Mar 15 at 18:39

You could do what the browser does, i.e. connect to the proxy,

$ telnet proxy-server 3128

and talk to it. If there was no authentication, a simple GET request (followed by two newlines (Enter)) with a full hostname and protocol, e.g.


should suffice. Since you need authentication, you need to provide your username and password base64-encoded in a Proxy-Authentication header, e.g.

Proxy-Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

To create the base64 string, you could use echo -n username:password | openssl base64

share|improve this answer
Link has been dead . can you update ? –  john Mar 15 at 18:40
Done (kind of)... –  sr_ Mar 16 at 9:22

Your Answer


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.