Mysql does a exact match of the hostname when it verifies a connection, so server1 and server1.example.com are different hostnames for mysql.
I've never added anything to host files and all of my script works perfectly with remote mysql.
Then you have setup the hostnames of your server correctly in dns which is good, but most poeple dont do that or at least they dont do that before they install the server. If you setup the hotnames in mysql before you install the first server and dont use the hosts file, then its ok.
Btw, this is not ispconfig specific, its common for all mysql installations and applications that use mysql.