Dnsmasq question

Just a quick question about dnsmasq and making static DHCP leases. Yesterday I made a bunch of them and somehow this messed up dnsmasq. I checked with netstat, and it appeared to stop running.

I was able to restore my router configuration from a backup, but when I diff'd the before/after /etc/config/dhcp files, it really only seemed to be the additions to the static hosts that were any different.

Are there limits to adding static DHCP hosts? I had 25-30 of them I think. Otherwise there must be something poisonous about that /etc/dhcp file I can't put my finger on yet, so any advice about how to inspect my running dnsmasq and make sure it's healthy is appreciated.

Thanks.

Searching the dnsmasq manual, I see no such setting.

  • Do want to paste the config (redacting things like MAC addresses)?
  • Perhaps there was some syntax issues in the leases - did you use the web GUI?

See: https://openwrt.org/docs/guide-user/base-system/dhcp#static_leases

Did your DNS resolution stop too?

1 Like

Usually dnsmasq will report in logs why it didn't start. Did you check that?
logread | grep -i dnsmasq

2 Likes

Indeed the DNS resolution (for IPv4) stopped, which certainly made it more difficult to deal with, but I was able to still get to the website through its IPv6 address.

I did use the GUI. It seemed like the trouble all started upon the last host I added. When I looked, that host entry only had three lines: an IP, hostname, and a MAC. It didn't have a lease time line line like the other hosts. Also, there wasn't a newline at the end of the file.

After restoring my backup, I tried copy/pasting the host entries back into the /etc/config/dhcp file without the last host... which is where I thought the issue was, but unfortunately dnsmasq failed again.

I think I have enough info to fix the problem. Hopefully dnsmasq will give line numbers in that log if it chokes on syntax errors. Thanks again.

1 Like

Thanks, I found the problem. I had mistakenly duplicated an IP in one of the entries. dnsmasq's complaint was pretty clear in the log.

2 Likes

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