Description of problem: "telnet 0 25" does not connect to
localhost:25. Instead it throws an error "0: Name or service no known".
Version-Release number of selected component (if applicable):
How reproducible: fails every time
Steps to Reproduce:
1. telnet 0 25
3. weep some more
telnet: 0: Name or service not known
Connected to 0.0.0.0.
Escape character is '^]'.
220 hostname ESMTP Sendmail 8.12.10/8.12.10; Fri, 8 Oct 2004 13:36:17
For the past - Oh, I don't know, two decades? - 0 resolves to
127.0.0.1, and so "telnet 0 25" would connect to the local machine's
smtp server, or "telnet 0 80" connects to the local HTTP server. Not
so in RHEL3. WTF?
$ which telnet
and do you have ipv6 enabled?
ipv6 is not enabled. Turns out the telnet in my path was
/usr/kerberos/bin/telnet, but /usr/bin/telnet returns the same error.
I believe this is not a bug in telnet after all, but glibc's
gethostbyname(). In fact, it looks like this was broken intentionally
in the glibc 2.3 series, for some reason. gethostbyname() no longer
resolves undotted decimal addresses, or hexadecimal or octal
addresses. It used to, but not anymore. "telnet 0 25" is one of the
Both gethostname ("0") and getaddrinfo ("0", NULL, NULL, &res);
return the same thing as they used to.
So the change is not in glibc.
well, nothing change in the source code of telnet
Retested. Works for me on a RHEL3-U3...
doh... fell in the trap... tested with /usr/kerberos/bin/telnet (which works)
/usr/bin/telnet failed like described in the bug report.
With a RHEL3-U4 glibc:
getaddrinfo("0", "25", 0xbfffe250, 0xbfffd9e4) = -2
gai_strerror(-2) = "Name or service not known"
Ok, this seems to be http://sources.redhat.com/bugzilla/show_bug.cgi?id=296
Should be fixed in glibc-2.3.2-95.32.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.