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