Login via FTP fails with "Service not available, remote server has closed connection" error.

Created:

2016-11-16 13:01:05 UTC

Modified:

2017-08-16 17:40:27 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Login via FTP fails with "Service not available, remote server has closed connection" error.

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

FTP connection to the server cannot be established. FTP client returns the error:

421 Service not available, remote server has closed connection

The following error message is seen in the /var/log/messages log file:

getaddrinfo 'Hostname\_Is\_Here' error: Name or service not known warning: unable to determine IP address of 'host.domain.tld domain'

Cause

This problem happens because FTP server is unable to determine the IP address of the server by hostname. Check it with the following command:

ping `hostname`

Resolution

Define correct hostname in the configuration files below and restart network service.

/etc/hosts
/etc/sysconfig/network

The following example shows how to set up hostname "hostname.domain.tld" on RedHat systems.

/etc/hosts:
127.0.0.1 localhost localhost.localdomain
11.22.33.44 hostname.domain.tld hostname

/etc/sysconfig/network:
HOSTNAME=hostname.domain.tld

# /etc/init.d/network restart

Where "11.22.33.44" and "hostname.domain.tld" have to be replaced with the real server IP and hostname accordingly.

Also, in the latest Parallels Plesk Panel versions hostname can be set through Plesk CP on the Server->Preferences page.

Have more questions? Submit a request
Please sign in to leave a comment.