Skip to content
Contents
GuidesOpenWrt

Why are OpenWrt DNS queries missing from the system log?

If lookups work but LuCI shows no queries, check where dnsmasq writes them. Some ImmortalWrt builds add log-facility=/dev/null. Discarded entries cannot be recovered, but you can test a fresh lookup.

If lookups work but LuCI shows no queries, check where dnsmasq writes them. Some ImmortalWrt builds add log-facility=/dev/null. Discarded entries cannot be recovered, but you can test a fresh lookup.

Identify the instance receiving the query

In LuCI under Network → DHCP and DNS, note the query logging setting. Enable it briefly and apply if needed. Run the first command on a PC with your router’s LAN IP. If there is no reply, check the listener and firewall first. Run the second block over SSH on the router. Match the process’s -C path. Look for log-queries. If log-facility names a regular file, read that file. If SSH already shows the query, clear the LuCI filters and refresh.

nslookup openwrt.org 192.168.1.1
logread -e openwrt.org | tail
uci show dhcp | grep -E 'logqueries|logfacility'
ps w | grep '[d]nsmasq'
grep -nE '^(log-queries|log-facility|conf-file)' /etc/dnsmasq.conf /var/etc/dnsmasq.conf.*

OpenWrt 25.12.6 · SSH · before.lan

Test a confirmed discard setting

The screenshots use two isolated OpenWrt 25.12.6 VMs with the discard line added by hand and local names such as before.lan. Continue only if the instance reads /etc/dnsmasq.conf and that file contains exactly the standalone line below with no competing destination. For UCI or plugin settings use their own controls. Leave generated files alone. Save an off-router copy first. Restarting may interrupt DNS and DHCP. Run one block at a time and stop on errors. The temporary backup must be new and vanishes on reboot. Replace the entire INSTANCE path with the actual configuration path.

test ! -e /tmp/dnsmasq.before &&
cp -p /etc/dnsmasq.conf /tmp/dnsmasq.before &&
sed -i '/^log-facility=\/dev\/null$/d' /etc/dnsmasq.conf
dnsmasq --test -C /var/etc/dnsmasq.conf.INSTANCE && /etc/init.d/dnsmasq restart

Repeat the first lookup on the PC, then run this on the router immediately. Match the time, query and client. The screenshot shows a separate client at 192.168.1.8 and the router at 127.0.0.1. If only local queries appear, check which instance the PC contacts.

logread -e openwrt.org | tail -n 10

OpenWrt 25.12.6 · SSH · after.lan

Restore the original privacy settings

If syntax validation or restart fails, the test is inconclusive or logging was temporary, restore this run’s backup. Check for intervening edits first. Never use an older file if the backup step failed.

cp /tmp/dnsmasq.before /etc/dnsmasq.conf && /etc/init.d/dnsmasq restart

OpenWrt 25.12.6 · SSH · final.lan

Undo any temporary logging change. Check that clients still resolve names. With discarding restored, new names should disappear from the system log. Older entries may remain. Redact names and addresses before sharing.

What does an OpenWrt configuration backup restore?

Explore hardware

Comments