Operating System - Linux
1824983 Members
3602 Online
109678 Solutions
New Discussion юеВ

Re: ftp connection pauses before asking for a login prompt

 
SOLVED
Go to solution
Debbie Fleith
Regular Advisor

ftp connection pauses before asking for a login prompt

What would cause an ftp session to take several minutes before it issues a login prompt?

I have this problem even from the Linux server itself. I can start ftp and then issue "open localhost 3021" (a custom version of ftp is running on 3021) and I get my ftp login right away as normal. However, if I try to "open ip_address 3021", it takes a very long time to get my login prompt. This used to work fine and I'm not sure what may have changed.

10 REPLIES 10
Steven Schweda
Honored Contributor

Re: ftp connection pauses before asking for a login prompt

"localhost" is, I assume, 127.0.0.1, while
"ip_address" is, I assume, some other IP
address. (If you would post actual commands
with actual output, I might not need to
_assume_ anything.) The usual explanation
for a pause like this is that the server
(here, the FTP server) is trying to look up
the name associated with the IP address of
the client which is connecting to it. It
would be unusual if such a reverse look-up of
127.0.0.1 were anything but trouble-free, but
it's more likely that there's a DNS problem
which causes a reverse look-up of
"ip_address" to fail (often slowly). As a
quick test, you could try (on the server):

nslookup ip_address

If that's slow, then you probably have a
reverse DNS problem.
James R. Ferguson
Acclaimed Contributor

Re: ftp connection pauses before asking for a login prompt

Hi Debbie:

I agree with Steven that a probable explanation for the delay is due to a DNS reverse name lookup.

Another way to verify that this is causing your problem is to add the ip_address in question to your '/etc/hosts' file. If the lookup order in '/etc/hosts.conf' is "hosts,bind" then the '/etc/hosts' will be consulted before the DNS server. The elimination of the delay would point to a reverse-name lookup.

Regards!

...JRF...
Mark McDonald_2
Trusted Contributor

Re: ftp connection pauses before asking for a login prompt

I have seen this before, and I agree with the above, it was a DNS problem. My machine only had one nameserver in resolv.conf. That server had gone down.

Check nslookup both on the ip and the hostname, how long do these take?
Fredrik.eriksson
Valued Contributor

Re: ftp connection pauses before asking for a login prompt

This is quite a usual occurance (atleast for me :P) in opensshd.
Since I'm not sure which ftpd you're running I'm just going to suggest to look for some config option telling your daemon to reverse lookup addresses or to use DNS at all. Normal operation doesn't need to use dns lookups for client connections (unless you're ├Г┬╝ber paranoid and want to use FQDN/FQHN).

Anyway, hope this gives you a lead :)

Best regards
Fredrik Eriksson
Fredrik.eriksson
Valued Contributor

Re: ftp connection pauses before asking for a login prompt

Oh almost forgot, it can be in some ftpd's that it's trying to do a ident check or auth check. Should be config options for that also.

Best regards
Fredrik Eriksson
Brendan Peter Murphy
Occasional Advisor

Re: ftp connection pauses before asking for a login prompt

Aside from DNS being the most likely culprit, similar problems can also sometimes be a mismatch between the NIC speed & the switch port speed. Check the NIC speed with ethtool,

eg :
# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: g
Current message level: 0x000000ff (255)
Link detected: yes


Then check your network switch port is matches what you NIC speed.... in this case 100Mb/Full Duplex, card set to autonegotiate.

Regards,

Brendan
Steven Schweda
Honored Contributor

Re: ftp connection pauses before asking for a login prompt

> I have this problem even from the Linux
> server itself. [...]

> [...] mismatch between the NIC speed & the
> switch port speed. [...]

I'd expect such a hardware configuration
problem not to have much effect when the bits
don't actually leave the one system. And if
it did, I'd expect more trouble than a
one-time delay when the connection is formed.

> [...] I'm not sure what may have changed.

That'll probably be the real mystery.
Debbie Fleith
Regular Advisor

Re: ftp connection pauses before asking for a login prompt

More info in response to above questions:

1. nslookup by ip_address never returns an address:

nslookup -silent 10.100.0.22
Server: 10.100.0.19
Address: 10.100.0.19#53

** server can't find 22.0.100.10.in-addr.arpa: SERVFAIL

2. more /etc/host.conf
order hosts,bind

3. /etc/hosts entries:
127.0.0.1 localhost.localdomain localhost
10.100.0.22 vmms.brown1.local vbrown

4. nslookup by hostname works:
nslookup -silent vmms.brown1.local
[root@vbrown gbg]# nslookup vmms.brown1.local
Server: 10.100.0.19
Address: 10.100.0.19#53

Name: vmms.brown1.local
Address: 10.100.0.22

5. The switch settings match the settings returned by ethtool.

Any other ideas would be appreciated.




James R. Ferguson
Acclaimed Contributor
Solution

Re: ftp connection pauses before asking for a login prompt

Hi (again) Debbie:

If the 'nslookup' by name works but the lookup by IPaddress doesn't, then the DNS server is missing the PTR record to enable reverse lookups.

Speak to whoever manages your DNS server and have the record added.

Regards!

...JRF...
Steven Schweda
Honored Contributor

Re: ftp connection pauses before asking for a login prompt

> ** server can't find 22.0.100.10.in-addr.arpa: SERVFAIL

And was this slow enough to account for the
delay when opening an FTP session? Sure
smells like a reverse DNS look-up problem to
me.