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

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

On Debian possible default full paths are:

/bin/ypdomainname - from package: hostname

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