I'm running a Virtual Private Server to host some websites. I have a PHP script that tries to fetch resources from the server, essentially using a curl command to the server (http://example.com/files/resource.txt) which fails. I've tried simulating the command from the server terminal which fails with a timeout and even when I ping the server (example.com) I get 100% packet loss.
However, if I try to curl the same file from elsewhere, it succeeded. Additionally, if I try to curl any other website from the server that succeeds.
So my suspicion is that the server doesn't know where to go to get to example.com. I have found mentions of using the command line parameters for curl but that won't solve the problem with curl'ing from PHP.
Any ideas?
Server: Debian 7.6
DNS: bind9
Other: apache2, nginx, exim4, dovecot, mysql, vsftpd, cron