Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

when I run '(sleep 1; echo flush_all; sleep 1; echo quit; ) | telnet localhost 11211' I get

Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
OK
Connection closed by foreign host.

The above command does what I want but what about the ::1 part?

share|improve this question

3 Answers 3

up vote 7 down vote accepted

The software listening on port 11211 doesn't support IPv6. Since localhost is an entry in the hosts file that tries an IPv6 address first, you only fail back to IPv4 after IPv6 fails. You can solve the issue by either getting the software updated (or properly configured to listen on IPv6 if it's an option in the config file) or changing your command to telnet 127.0.0.1 instead of telnet localhost.

share|improve this answer
    
fixed, works + great explanation. Thank you. –  Radek Apr 18 '11 at 0:55

::1 is the IPv6 loopback address, the equivalent of the IPv4 loopback 127.0.0.1.

share|improve this answer

To avoid the ipv6 connexion, use the '-4' switch:

$ telnet -4 localhost
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

The same with '-6' :

$ telnet -6 localhost
Trying ::1...
Connected to ::1.
Escape character is '^]'.

It works with a lot of network utilities, like wget, curl, ssh,...

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.