hostname: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/bin/hostname - from package: net-tools

You may install the required package with command yum install {package}

On Debian possible default full paths are:

/bin/hostname - from package: hostname

You may install the required package with command apt-get install {package}
Error in other languages:
hostname: bevel nie gevind nie
hostname: comandă negăsită
hostname: comando não encontrado
hostname: commande introuvable
hostname: command not found
hostname: käsku ei ole
hostname: không tìm thấy lệnh
hostname: komanda nerasta
hostname: Kommando nicht gefunden.
hostname: kommandot finns inte
hostname: komut yok
hostname: nie znaleziono polecenia
hostname: níor aimsíodh an t-ordú
hostname: no se encontró la orden
hostname: no s'ha trobat l'ordre
hostname: opdracht niet gevonden
hostname: parancs nem található
hostname: perintah tidak ditemukan
hostname: príkaz nenájdený
hostname: příkaz nenalezen
hostname: команда не найдена
hostname: командата не е открита
hostname: 命令找不到
hostname: コマンドが見つかりません