Try to stay below the Zabbix timeout default of 3 seconds.

Lower the number of UDP queries from 3 (default) to 2 and the query
timeout to one second, which gives us a theoretical maximum execution
time of two seconds. Which should be below the Zabbix default of three
seconds.
Enhanced error handling of dig return codes.