Librenms ignoring hosts file

/validate.php output:

===========================================

Component Version
LibreNMS 23.1.0-24-gb0ac39e30 (2023-02-10T20:51:42+00:00)
DB Schema 2022_08_15_084507_add_rrd_type_to_wireless_sensors_table (248)
PHP 8.1.13
Python 3.8.10
Database MariaDB 10.3.37-MariaDB-0ubuntu0.20.04.1
RRDTool 1.7.2
SNMP 5.8
===========================================

[OK] Composer Version: 2.5.3
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database and column collations are correct
[OK] Database schema correct
[OK] MySQl and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[WARN] Using database for locking, you should set CACHE_DRIVER=redis
[OK] rrd_dir is writable
[OK] rrdtool version ok

I’m trying to take load off my small DNS server. Librenms is generating hundreds of lookups a day.

I setup the /etc/hosts file (on the librenms server) to contain all the correct DNS entries, ping/dig/drill all function correctly using the names in the hosts file.
/etc/nsswitch.conf shows file is set before dns:

hosts: files dns
networks: files

However when I check the logs on my DNS server is see the librenms server still polling directly to the DNS server.

Can someone confirm why this is and can it be changed so that it uses what’s configured on the system?

I would recommend checking out this thread:

I shouldn’t need to install yet another DNS server just so Librenms can do what it wants which is clearly wrong.

Why can’t LibreNMS just do look ups correctly and just use what the OS is telling it to use?

This is surely a bug that’s been classed as: “Won’t Fix because whatever!”

Well, that’s a bit harsh. It’s important to remember that this is an open source project. You have as much ability to fix a “bug” as anyone else here.

Like yourself, I’m not a member of the LibreNMS team. I’m just someone on the internet who uses the software, has contributed to it and who tried to give you a helpful suggestion. Which was setting up a small recursive DNS process directly on your LibreNMS server. This basically just adds some DNS caching locally and improves LibreNMS performance in general. These days, you’ll find that a lot of desktop Linux distros do this out-of-the-box for this very reason.

The answer to your question…

Why can’t LibreNMS just do look ups correctly and just use what the OS is telling it to use?

…was covered in that thread. LibreNMS for the most part calls various other utilities and gathers data from them. If Net-SNMP’s snmpwalk handles resolution one way, smokeping handles it another, and each Nagios service check handles it in whatever way their authors liked, etc., that’s not something that can really be fixed by LibreNMS because very few of those DNS requests will actually be coming directly from LibreNMS code.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.