These are the things I have tried :
$_SERVER['SERVER_NAME'] : sub..amazinglocal.com
$_SERVER['HTTP_HOST'] : amazinglocal.com
php_uname('n') : sub..amazinglocal.com
gethostbyname()
I need the kind of name that is the output of command hostname
on the server.
Example : appmysql.staging.la3.do.amazing.com
Okay so I've tried a couple of more options and this one works the best : gethostname()
gethostname() : vagrant-ubuntu-trusty-64
On the server, it'll throw an ouput like :
mysqlapp1.prod.do.superawesomeserver.com