[ZBX-26328] Add logging of the reverse dns lookup performed when trapper is checking for host (active checks) Created: 2025 Apr 17  Updated: 2025 Jul 15

Status: Need info
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: None
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Piotr Zakrzewski Assignee: Piotr Zakrzewski
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-1.png    
Issue Links:
Duplicate

 Description   

Version where reported: 6.0.33

When performing Active Checks, there is a reverse-DNS lookup being made, but there's no indication of that in logs. 

While performance of Zabbix Proxy decreased for unknown reason, it seemed that this query:

select h.hostid,h.status,h.tls_accept,h.tls_issuer,h.tls_subject,h.tls_psk_identity,a.host_metadata,a.listen_ip,a.listen_dns,a.listen_port,a.flags from hosts h left join autoreg_host a on a.proxy_hostid is null and a.host=h.host where h.host='FVXXXXXXXXXX' and h.status in (0,1) and h.flags<>2 and h.proxy_hostid is null] 

 

is taking very long to execute, but in fact it was very fast (2s), while the whole operation is logged for ~8s in logs.

The reason for it taking so long, was one of the DNS servers was slow.

It has been checked with packet capture that there indeed is a reverse-dns lookup being made, when performing that active check, but it's not being logged.
Therefore problem was not with the proxy/server itself, but rather with DNS server, which took too long to figure out. 

There's a request to include in logs, that the the DNS lookup is being performed.

 

Steps to reproduce:

  1. Have a local DNS resolver
  2. Configure active checks to some host
  3. Run the packet capture
  4. See in packet capture that DNS lookup is being performed at the time of logged Active check in proxy/server

Result:

Expected:
Entries in log, indicating that such operation was performed (DNS lookup), possibly with the time it took.



 Comments   
Comment by Alexander Vladishev [ 2025 Jul 15 ]

Logging calls to such low-level functions could lead to extremely heavy log file growth. I don't think that's a good idea.

In the latest version, 6.0.40, additional debug output has already been added for the db_register_host() function, which directly performs the DNS query and inserts a record into the "proxy_autoreg_host" or "autoreg_host" table. This somewhat narrows down the search for the cause of the delay.

Would that be sufficient?

Generated at Wed Apr 01 10:00:22 EEST 2026 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.