From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4+) Gecko/20010914
Description of problem:
When attempting to connect by name using telnet 0.17.6x-18 there are
very long delays before anything is displayed, including the "Trying
{ipaddr}..." message.
The destination computer name is in /etc/hosts, and /etc/host.conf states
"order hosts,bind", yet it appears that telnet is still trying a DNS
lookup, which for the host in question will not work.
Attempting to connect by IP address immediately connects.
Is telnet ignoring /etc/host.conf for some reason?
Version-Release number of selected component (if applicable):
0.17.6x-18
How reproducible:
Always
Steps to Reproduce:
1. place host name in /etc/hosts - host must not resolve via DNS
2. verify /etc/host.conf contains "order hosts,bind"
3. run "telnet {hostname}"
Actual Results: Long delay, eventual connect.
Expected Results: Immediate connect.

I've noticed the same thing here... (on RH7.1 & 7.2) My "fix" is the attached
patch which adds a new argument -N to optionally disable DNS-lookups. And I
wouldn't mind at all if this showed up in the next RH telnet package :)

BTW I'm not talking about localhost here but something that doesn't exist in DNS
at all. Also I found out that the kerberos-version of telnet doesn't seem to
make a DNS-lookup if it's given an IP instead of a hostname.

Er, apparently nobody there has twigged to this yet:
http://sources.redhat.com/ml/libc-alpha/2001-11/msg00125.html
I only got wind of this a couple of days ago, and thought it'd be known to the
telnet maintainers, so I didn't post anything.
The bug is that telnet is now trying IPv6 lookups even though an IPv4 hostname
is in the local hosts file.
If there is an IPv4 entry in /etc/hosts for the system name, an IPv6 DNS lookup
SHOULD NOT occur.
Okay, now that we know what is happening - when can we expect a fix? :)

The best fix for RHL62 errata (where IPv6 was not supported yet) is to change
the reference
from PF_UNSPEC to PF_INET. Then getaddrinfo defaults to IPv4 lookups first.
(perhaps this should be filed against telnet separately.)
Anyway, marking this as a duplicate of a latter report on the same subject.
*** This bug has been marked as a duplicate of 57998 ***

Note

You need to
log in
before you can comment on or make changes to this bug.