What triggers these events: kern.info dnsmasq[1]: read /etc/hosts - 12 names

Quite a few times per hr I see the following messages in the syslog file. There does not seem to be a fixed time interval in between them.

  1. What causes these events
  2. How do I silence these messages in syslog?

I have Wan connection using dhcp and ISP uses 10 min lease time, so lots of IP renew request but not in sync with the following messages

Mon Feb 17 14:04:44 2025 kern.info dnsmasq[1]: read /etc/hosts - 12 names
Mon Feb 17 14:04:44 2025 kern.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 71 names
Mon Feb 17 14:04:44 2025 kern.info dnsmasq[1]: read /tmp/hosts/odhcpd - 44 names
Mon Feb 17 14:04:44 2025 kern.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses
Mon Feb 17 14:05:02 2025 kern.info dnsmasq[1]: read /etc/hosts - 12 names
Mon Feb 17 14:05:02 2025 kern.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 71 names
Mon Feb 17 14:05:02 2025 kern.info dnsmasq[1]: read /tmp/hosts/odhcpd - 48 names
Mon Feb 17 14:05:02 2025 kern.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses

Usually it’s from the odhcpd IPv6 daemon serving LAN DHCPv6 to clients. When a new LAN client comes online, and gets a DHCPv6 lease, it updates dnsmasq. See how the odhcpd entries increased from 44 to 48?

1 Like

Use the following settings:

config odhcpd 'odhcpd'                                         
        option maindhcp '0'                                    
        option leasefile '/tmp/hosts/odhcpd'                   
        option leasetrigger '/usr/sbin/odhcpd-update'          
        option loglevel '3'

level 3 : err, should the info messages not be there?

odhcpd isn’t the program logging the messages. It’s dnsmasq. odhcpd is triggering the update.

Have
option quietdhcp '1'
and no other loggin options in the dhcp file under config dnsmasq, is there an other option needed to suppress these log messages?

You can delete the leasetrigger option from odhcpd to prevent odhcpd trying to add DNS entries for IPv6 leases to dnsmasq. Otherwise, no, the log messages themselves aren't configurable.

Many thanks for answering my questions. Much appreciated. Would it be worth to open a change request for adding a log level for dnsmasq deamon ?

You would need to submit it to the dnsmasq project, not OpenWrt. If it were me, I wouldn’t waste my time. But if you do not ask, the answer is certainly “no.”

Hello Dave
Looking at the dnsmasq code , all log messages are send via vsyslog function following the syslog level convention, reading files like hosts file are logged with LOG_INFO. Am I right that these messages end up at the openwrt logd service? If that is the case , we're stuck logd does not seem to be supporting filtering log levels.