Bug 53929 - long delays connecting if host does not resolve via DNS, even if in /etc/hosts
long delays connecting if host does not resolve via DNS, even if in /etc/hosts
Status: CLOSED DUPLICATE of bug 57998
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2001-09-21 16:49 EDT by John Hardin
Modified: 2007-04-18 12:37 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-12-13 15:11:12 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to optionally disable DNS lookups (3.01 KB, patch)
2001-12-13 04:50 EST, panu.matilainen
no flags Details | Diff

  None (edit)
Description John Hardin 2001-09-21 16:49:55 EDT
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):

How reproducible:

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.
Comment 1 John Hardin 2001-09-21 19:45:54 EDT
New info: now I am seeing the delay on "telnet {ipaddr}" - what the heck could
cause *that*?
Comment 2 John Hardin 2001-11-05 17:08:53 EST
So, any progress on figuring out what the heck is going on here?
Comment 3 panu.matilainen 2001-12-13 04:50:19 EST
Created attachment 40471 [details]
Patch to optionally disable DNS lookups
Comment 4 panu.matilainen 2001-12-13 04:51:04 EST
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 :)
Comment 6 panu.matilainen 2001-12-13 09:15:14 EST
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.
Comment 7 John Hardin 2001-12-13 11:44:51 EST
Er, apparently nobody there has twigged to this yet:

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
Okay, now that we know what is happening - when can we expect a fix? :)
Comment 8 John Hardin 2001-12-13 15:11:07 EST
It seems telnetd may also be subject to this bug...
Comment 9 Pekka Savola 2002-01-18 03:04:21 EST
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.