To monitor the DNS service itself on the port, you can use the following key in the data items (where SERVER is the IP address or DNS server domain):
In order not to create a template from scratch, you can clone eg the standard “Template App SSH Service” by changing the name in it and specifying a new key, the trigger will change automatically. And also in the “Type” we select “Zabbix agent” instead of a simple check.
The next command can be checked from the Linux command line:
zabbix_get -s127.0.0.1 -k'net.tcp.dns[SERVER]'
Naturally, if the answer is 1, the DNS service is started, 0 is not.