1

Getting "Couldn't resolve host name: Could not resolve host: example.zabbixagent.com; Name or service not known" in Zabbix server although DNS and hostname of Zabbix Active Agent is correct. Is this a bug or a misconfiguration in Zabbix? Please help.

user427751
  • 125
  • 1
  • 3
  • 9

3 Answers3

0

The question does not mention, so I assume probably not, but if zabbix is running inside docker this error might occur due to docker's network configuration.

Solutions are either to add an explicit dns entry in the docker daemon configuration like:

{
        ...
        "dns":["208.67.222.222","208.67.220.220"],
        ...
}

This worked for me. I guess alternatively adding an additional host network entry like suggested in this answer also might work:

services:
  mycontainer:
    ...
    networks:
      ...
      - bridge
...
networks:
  ...
  bridge:
    external: true

When testing, notice that curl's domain name resolving is more picky than say ping, e.g you might have

$ docker exec -ti mycontainer ping -c 3 myhost.example.com   # Works
$ docker exec -ti mycontainer curl myhost.example.com        # Fails

and zabbix' web monitoring uses/depend on curl, so "ping works ok" is not good enough tests.

hlovdal
  • 1,115
  • 11
  • 18
0

If this resolves from the commandline by copy-pasting the name (not retyping), it is likely that you have changed resolv.conf. In earlier versions of Zabbix you have to restart the daemons after changing that file. As you have not specified the Zabbix version, assuming your version still needs that restart.

If that does not help, copy the host DNS from the host properties and do ping, dig or similar from the server box and make sure to adjust the host setting to the correct name.

Richlv
  • 2,354
  • 1
  • 13
  • 18
  • Hi @Richlv, Thanks for your response. I found out that the issue was with anything other than the external DNS that was not been updated with the new domain name that was configured recently for that particular host. After adding the new domain name and removed the old one from the DNS list, Zabbix server was able to resolve the host resolution issue. – user427751 Mar 22 '18 at 18:25
0

Answer given in a comment by user427751:

I found out that the issue was with anything other than the external DNS that was not been updated with the new domain name that was configured recently for that particular host. After adding the new domain name and removed the old one from the DNS list, Zabbix server was able to resolve the host resolution issue.

Andrew Myers
  • 113
  • 1
  • 8