ISPConfig Multiserver, PHP ignores hosts file

Discussion in 'Installation/Configuration' started by SilentHunter, May 16, 2016.

  1. SilentHunter

    SilentHunter New Member

    I have setup a multiserver cluster (version below 3.1), where the database is running on a different server. All Servers are listed under /etc/hosts, but when I try to connect from php (FPM) and I have entered the hostname which is in this file, it can not resolve the ip address.

    How do I connect to DB Server without using IP Adresses and public DNS entries?
  2. Jesse Norell

    Jesse Norell Active Member

    What happens testing mysql connection by hostname from the command line? Putting the hostnames/addrs in /etc/hosts is the right thing to do there, so either the entries aren't correct (misspelled or wrong syntax?), or they're not being used. If your php-fpm daemon is running in chroot environment, you'd need to edit the /etc/hosts file inside that chroot environment as well. If that's not it, maybe check /etc/nsswitch.conf and make sure you have 'files' listed first for hosts resolution.
  3. SilentHunter

    SilentHunter New Member

    From the console it is running pings etc. without any problems, when I log in into an chrooted ssh account and display the /etc/hosts file, everything seems to be correct...

Share This Page