cPanel: php_network_getaddresses: getaddrinfo failed: Name or service not known

I found out this problem just after the disk replace on backup drive but have no idea why it is occurred. However, the fixes is found.

With this issue, you may find the following error,

In SquirrelMail:

Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:143 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /usr/local/cpanel/base/3rdparty/squirrelmail/plugins/login_auth/functions.php on line 129

In HordeMail:

Login failed because your username or password was entered incorrectly.

In RoundCube:

Connection to IMAP server failed.

To resolve this problem, try to check the following issue,
1. If /etc/nsswitch.conf is exists.
2. If the permission of /etc/nsswitch.conf is 644, else do,

chmod 644 /etc/nsswitch.conf

3. check if /etc/nsswitch.conf come with any content. Update your system to get the fresh content.

Published by

Mick Genie

Mick Genie is the founder of and working at ExaBytes Network Sdn Bhd and WPWebHost web host company. He is expertise in Windows and Linux environment especially web hosting related information, tips and trick as well as the IT Information.