ypwhich: 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:

/usr/bin/ypwhich - from package: yp-tools

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

On Debian possible default full paths are:

/usr/bin/ypwhich - from package: nis

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