dnsmasq: 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/sbin/dnsmasq - from package: dnsmasq

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

On Debian possible default full paths are:

/usr/sbin/dnsmasq - from package: dnsmasq-base

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