[lib] fix bug in dnsmasq, improve output