Symptoms
Plesk installation or update fails with the following error message:
...
Trying to resolve hostname ‘localhost.localdomain’ and validate its IP address…
Unable to resolve host name.
Please specify the host name in the /etc/hosts file or specify DNS configuration in the /etc/resolv.conf on your system.
ERROR while trying to check the hostname
....
Cause
Misconfiguration of the /etc/hosts
file or invalid PTR record.
Resolution
-
Connect to the server via SSH
-
Back up the current
file:
/etc/hosts
# cp -a /etc/hosts{,.backup}
-
Edit theÂ
/etc/hosts
 file as follows:Note: The second line starting with
::1
should be added only if the system has IPv6. This can be verified with the following command:ip -6 a
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
203.0.113.2 plesk.example.com hostWhere:
–
203.0.113.2
is the main IP address
–plesk.example.com
is the hostname:Â How to change or get the server hostname on Plesk server -
Make sure that the main IP address has a valid PTR record resolving to a valid FQDN hostname:
# dig +short -x 203.0.113.2
plesk.example.com.