Since $_SERVER['SERVER_NAME'] is not available under CLI, also use gethostname()