domainname: 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/domainname - from package: net-tools

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

On Debian possible default full paths are:

/bin/domainname - from package: hostname

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