[ZBX-24572] Host agent dont work with DNS name settings Created: 2024 Jun 02  Updated: 2025 Mar 24  Resolved: 2025 Mar 24

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 7.0.0rc3
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Pavel Mlcoch Assignee: Zabbix Development Team
Resolution: Duplicate Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

[root@zabbix adminlocal]# rpm -qa | grep postgres
postgresql16-libs-16.3-1PGDG.rhel9.x86_64
postgresql16-16.3-1PGDG.rhel9.x86_64
postgresql16-server-16.3-1PGDG.rhel9.x86_64
[root@zabbix adminlocal]# rpm -qa | grep zabbix
zabbix-release-6.5-2.el9.noarch
zabbix-web-7.0.0-rc3.release1.el9.noarch
zabbix-web-pgsql-7.0.0-rc3.release1.el9.noarch
zabbix-web-deps-7.0.0-rc3.release1.el9.noarch
zabbix-server-pgsql-7.0.0-rc3.release1.el9.x86_64
zabbix-apache-conf-7.0.0-rc3.release1.el9.noarch
zabbix-sql-scripts-7.0.0-rc3.release1.el9.noarch
zabbix-selinux-policy-7.0.0-rc3.release1.el9.x86_64
zabbix-agent-7.0.0-rc3.release1.el9.x86_64
[root@zabbix adminlocal]# cat /etc/redhat-release
Red Hat Enterprise Linux release 9.4 (Plow)


Attachments: PNG File image-2024-06-12-11-26-43-410.png    
Issue Links:
Causes
Duplicate
duplicates ZBX-26014 Zabbix passive agent checks fail rand... Closed
Related
related to ZBX-26014 Zabbix passive agent checks fail rand... Closed

 Description   

Steps to reproduce:

  1. Clean installation zabbix-server 7 with postgresql
  2. Configure zabbix-agent host only with dns name
  3. Host says not available with this error: Get value from agent failed: Cannot resolve address: nodename nor servname provided, or not known
  4. Test item manualy return values as expected
  5. Reconfigure host with ip address and switch to IP system
  6. Monitoring works

Result:
Working only with ip addresses

Expected:
Working both method, ip address and dns too



 Comments   
Comment by Pavel Mlcoch [ 2024 Jun 11 ]

After upgrade to release1 is not solved.

[root@zabbix pavel_mlcoch]# rpm -qa | grep zabbix
zabbix-web-7.0.0-release1.el9.noarch
zabbix-web-deps-7.0.0-release1.el9.noarch
zabbix-web-pgsql-7.0.0-release1.el9.noarch
zabbix-apache-conf-7.0.0-release1.el9.noarch
zabbix-sql-scripts-7.0.0-release1.el9.noarch
zabbix-server-pgsql-7.0.0-release1.el9.x86_64
zabbix-selinux-policy-7.0.0-release1.el9.x86_64
zabbix-agent-7.0.0-release1.el9.x86_64
zabbix-release-7.0-2.el9.noarch

Comment by Pavel Mlcoch [ 2024 Jun 11 ]

Debug log is full of this record with non-zero result:

 35301:20240611:114236.698 In async_dns_event() result:-2
 35301:20240611:114236.700 End of async_dns_event()

Comment by Benoit MOREAU [ 2024 Jun 12 ]

I think I have found the reason for this problem.

When you have multiple nameservers in your /etc/resolv.conf, it will distribute requests between them instead of follow the order priority.
It has no impact for most of configurations, but it will have when you have for example a private DNS nameserver with specific entries and a public DNS nameserver in your /etc/resolv.conf file.

In my case, I have a private DNS server in 10.1.217.2 and use 8.8.8.8 in case of failure.

And zabbix do these requests :


Unfortunately, the requested DNS entries doesn't exists publicly, and it doesn't have a AAAA entry locally.

Comment by Pavel Mlcoch [ 2024 Jun 15 ]

After configure DNS for only private server, it works. But in Z6.4 this working with both (private and public). Is this a bug in new dns caching?

Comment by Hernandes Martins [ 2024 Jun 27 ]

Here, after the upgrade the same situation.

Zabbix agent work very well in 6.4, after upgrade with DNS don't work.

Comment by Vitaliy [ 2024 Nov 06 ]

Hi,
the same issue on Zabbix 7.0.5.

Comment by Vladislavs Sokurenko [ 2024 Nov 14 ]

From the description it might seem related to https://github.com/libevent/libevent/pull/184

Comment by Vladislavs Sokurenko [ 2025 Feb 18 ]

Could you please be so kind and check if ZBX-26014 or ZBX-25899 help

Comment by Vladislavs Sokurenko [ 2025 Mar 06 ]

Hard to say for sure, to know exactly would need to see log and what those macros resolve to, if it was good DNS name then c-ares could help, also it might work with test item as it still uses glibc resolver.

Generated at Sun May 04 05:52:42 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.