# dnsmasq.log not being rotated

**URL:** <https://discourse.pi-hole.net/t/dnsmasq-log-not-being-rotated/87357>\
**Category:** Help\
**Created:** [August 23, 2026, 4:33pm UTC](https://discourse.pi-hole.net/t/dnsmasq-log-not-being-rotated/87357 "2026-08-23T16:33:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PWungsten](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/pwungsten/32/56155_2.png) [@PWungsten](https://discourse.pi-hole.net/u/PWungsten)\
**Post date:** [August 23, 2026, 4:33pm UTC](https://discourse.pi-hole.net/t/dnsmasq-log-not-being-rotated/87357/1 "2026-08-23T16:33:10Z")

</div>

## Expected Behaviour:

The file /var/log/pihole/dnsmasq.log should be rotated regularly. It used to happen every night, at midnight. Other logs are rotated

## Actual Behaviour:

The file /var/log/pihole/dnsmasq.log just keeps growing. The command 'ls -ltrh /var/log/pihole/dns\*' shows

-rw-r----- 1 pihole pihole 360K Jul 2 00:00 dnsmasq.log.5.gz  
-rw-r----- 1 pihole pihole 344K Jul 3 00:00 dnsmasq.log.4.gz  
-rw-r----- 1 pihole pihole 144K Jul 4 00:00 dnsmasq.log.3.gz  
-rw-r----- 1 pihole pihole 322K Jul 6 00:00 dnsmasq.log.2.gz  
-rw-r----- 1 pihole pihole 3.8M Jul 7 00:00 dnsmasq.log.1  
-rw-r----- 1 pihole pihole 163M Aug 23 15:26 dnsmasq.log

so it seems logrotate stopped processing this file on 7 July.

I have inspected /opt/pihole/piholeLogFlush.sh and could find no reference to dnsmasq.log. Many of the files in /opt/pihole, including this one, were touched on 7 July. Some files in /etc/pihole were touched at the same time.

I can find no reason why dnsmasq.log is treated differently to the other pihole logs.

How do I enable logrotate on dnsmasq.log? Is there any way of detecting what changed on 7 July?

Raspberry Pi 3B running Raspbian GNU/Linux 12 (bookworm).

---

<div class="post-metadata">

**Author:** ![tomporter518](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/tomporter518/32/3504_2.png) [@tomporter518](https://discourse.pi-hole.net/u/tomporter518)\
**Post date:** [August 23, 2026, 5:11pm UTC](https://discourse.pi-hole.net/t/dnsmasq-log-not-being-rotated/87357/2 "2026-08-23T17:11:32Z")

</div>

My Pi-hole v6 has no such log at that path. I do not remember if v5 had such a log. Are you on v5? Or perhaps upgraded to v6 from v5, which might explain the lack of rotation now? You might check the /etc/logrotate.d/pihole file for the current configuration on your system.

---

<div class="post-metadata">

**Author:** ![darkexplosiveqwx](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/darkexplosiveqwx/32/45118_2.png) [@darkexplosiveqwx](https://discourse.pi-hole.net/u/darkexplosiveqwx)\
**Post date:** [August 23, 2026, 5:29pm UTC](https://discourse.pi-hole.net/t/dnsmasq-log-not-being-rotated/87357/3 "2026-08-23T17:29:43Z")

</div>

Pi-hole uses `/var/log/pihole/pihole.log` instead of `/var/log/pihole/dnsmasq.log` as a default for [`files.log.dnsmasq`](https://docs.pi-hole.net/ftldns/configfile/#dnsmasq). You can inspect the logrotate file at `/etc/pihole/logrotate` (pre core v6.4.3) or `/etc/logrotate.d/pihole` (core v6.4.3+)

Edit: looking at commit [Merge commit from fork · pi-hole/pi-hole@18002bf · GitHub](https://github.com/pi-hole/pi-hole/commit/18002bf7c6bf382fe5861d01321f427019e1be89) which changed the location of the logrotate file, there doesn’t seem to be any migration of the old config. Instead, always the default config is installed. I suspect you had previously edited `/etc/pihole/logrotate`, which is no longer used. The release of this commit, with core v6.4.3, happened on the sixth of July. This lines up with your reported date of the seventh of July. You will need to change the path to your custom path inside `/etc/logrotate.d/pihole`

---

<div class="post-metadata">

**Author:** ![PWungsten](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/pwungsten/32/56155_2.png) [@PWungsten](https://discourse.pi-hole.net/u/PWungsten)\
**Post date:** [August 23, 2026, 7:14pm UTC](https://discourse.pi-hole.net/t/dnsmasq-log-not-being-rotated/87357/4 "2026-08-23T19:14:37Z")

</div>

> [@darkexplosiveqwx](#):
>
> /etc/pihole/logrotate

Thank you both for your thoughts. After inspecting lots of files, I found a line in /etc/pihole/pihole.toml that I must have changed.

I now have

dnsmasq = "/var/log/pihole/pihole.log"

and it seems to be working. I will be completely confident tomorrow, if the nightly logrotate is successful.

---

<div class="post-metadata">

**Author:** ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)\
**Post date:** [September 13, 2026, 7:15pm UTC](https://discourse.pi-hole.net/t/dnsmasq-log-not-being-rotated/87357/5 "2026-09-13T19:15:27Z")

</div>

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