dnsmasq and logrotate on ubuntu 20.04

I had same issues with dnsmasq and logrotate on ubuntu 20.04. Here is my solution:

In /etc/dnsmasq.conf the following entry is required:

log-facility=/var/log/dnsmasq/dnsmasq.log

Create /etc/logrotate.d/dnsmasq with the following content:

/var/log/dnsmasq/dnsmasq.log {
   size 100M
   weekly
   rotate 7
   compress
   missingok
   notifempty
   postrotate
      service dnsmasq restart
   endscript
}

The important thing was the restart of dnsmasq!

, ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: