I have a web server and database server sitting behind a public ip. The webserver is accessible to the public using NAT. A user can create and manage databases from the web server by makeing api calls to the database server using the private ip of the mysql server. But when i try to set the api call using the server's FQDN, it fails.
My server is running Ubuntu 16.04 and the webserver is powered by VestaCP. The database server runs Ubuntu 16.04 with MySQL Server 5.7. The webserver has a local ip of 192.168.1.4 and database server has ip of 192.168.1.6.
My /etc/hosts looks like this 192.168.1.4 cpanel.example.com example 192.168.1.6 db.example.com db
I have tried to set bind-address to 192.168.1.6. What could be wrong?
What could be the problem?