LibreNMS finds wrong host by hostname, even though ping provides correct IP address

Hi folks,

I have a device (my router) that works fine when the host name is set to its IP address (, but when I set the host name to the actual host name of the device (, LibreNMS considers it to be localhost. Logging in to the librenms user on the LibreNMS host and pinging yields the correct IP address (PING ( 56(84) bytes of data.)

When changing the host name to the actual host name, on the next poll, LibreNMS changes all of the device information over to match that of localhost (OS, ports, processor, everything). Changing back to the IP address of the router changes everything back to the correct data.

This was working fine until I had an extended power outage and my router (running both DHCP and DNS servers) did not come back up properly. After resolving that I power cycled pretty much everything in my network. All other devices tracked by LibreNMS are working fine by host name.


For some reason I never thought to dig the host name until just now. From the LibreNMS host I get:

;; ANSWER SECTION:    0       IN      A    0       IN      A

I’m going to go out on a limb and guess that that second record is part of the problem…

For what it’s worth, this is an EdgeRouter, and the reason is being returned is discussed here. After setting the override-hostname-ip configuration option as described to, a dig from the LibreNMS host now returns

;; ANSWER SECTION:    0       IN      A

I will now try to change back to the host name and see if it works now.

1 Like

Yes it seems to be working now. Sometimes it helps to put your problem down in words; forces you to think it through instead of short-circuiting :wink: