How to disable logging?

Hi their,

I wanted to ask you how I can disable the logging of non ad domains by Pi Hole because this would make it much more secure and private.

Thank you

Hi there,

Just had a little play with this. run the following command on a cron job every minute and it will clear out anything that isn't an ad domain.

sudo sed -i '/gravity.list/!d' /var/log/pihole.log

Though you're still going to see other domains in the log in between script runs, once a min is cron's limit.

You could try password protecting the web-interface? Create a file called /etc/lighttpd/external.conf and placing auth settings in there. That said, i'm not personally up to scratch on how to do that, but @Mcat12 may have a better idea!

1 Like

Hi PromoFaux,
thanks that worked. But when I now go to the query log it does not even show the domains of the blocked pages anymore :smiley:

But its a begging thank you. That the web interface is not password protected is not that big of an issue. Because the DNS server can only be accessed when connected to a VPN. But extra security is never a bad think :wink:

Edit: But when I would like it to be a password prompt by the web interface so no htaccess or so :smiley: Just as a feature request.

Ah yeah, didn't think to check the query log page!

And that makes sense. The way we parse the logs is a bit janky right now, to say the least, once we get some back-end database support in place, it will be much easier to filter out things without breaking the front end! (delete from queries where blocked=false, as an example in your case)

I also noticed after I ran the sed command that dnsmasq stopped logging, and I had to restart it to get it going again, so perhaps not an ideal solution!

Oh well so I will better disable to cron job for now... And wait till the update with the database backend comes out. Do you have any time frame for this maybe?

I would be very happy to test it out :slight_smile:

It's very pre-alpha right now... Take a look at it you like, could always use more testers.. but keep in mind that it could break at any time!

thank you, well I will consider trying it :smiley: But since its a productive server. pre-alpha does not sound good to use on it. Well will have to wait then...

But thank you :slight_smile:

I'll put it this way, I've been running it for the past month with no hiccups. As far as the actual blocking of domains goes, it works as per normal. The database additions are purely for improving the performance of the Admin page. :slight_smile:

Hi,

I just saw that a logOnlogOff branch was created. I would like to help test it if you don't mind. And maybe I am allowed to ask what exactly will be disabled by it when it is beeing turned off? Will everthing be disabled so the statistics on the dashboard with the query number and ad's blocked number too?

Thanks you, :slight_smile: This project is awesome!

The basic idea on the logOnlogOff branch is that it just toggles query-logging in /etc/dnsmasq.d/01-pihole.conf (You could do this manually, but the next update would reset it to default (on))

It's an all or nothing approach, and will literally log 0 queries!

Oh okay, I understand. Thank you for that implanting it into the project. Do you have an ETA for a release yet? Can't wait to use it :wink:

Ugh! Don't use the E word!

It'll be ready when it's ready :slight_smile:

Oh okay, I am sorry for doing so. I was just getting so exited and wanted to try it :smiley: So I used the E word...

If you really want to try it out, try:

cd /etc/.pihole
sudo git fetch
sudo git checkout logOnlogOff (this may not work as the install only checks out master)
pihole -r (choose "reconfigure")

Hi,
I know get this error:
error: pathspec 'logOnlogOff' did not match any file(s) known to git.

after entering git checkout logOnlogOff

Yeah, thought that might happen.

sudo rm -rf /etc/.pihole
sudo git clone https://github.com/pi-hole/pi-hole.git
cd /etc/.pihole
sudo git fetch
sudo git checkout logOnlogOff
pihole -r (choose "reconfigure")

Hi,
Thank you that worked just fine :slight_smile: Now the only think I noticed after also running the -f command to clear the log file that the web interface needs some update too in order work with this non logging system. Maybe it could then just list current blacklisted domains. And a message that logging is off and that no statistic data can be collected.

Yep. Before we get it actually released the web side will need some features added to accommodate it.

I just saw that the logOnlogOff branch disappeared what happened to it? :open_mouth:

It's now integrated into the development branch and slated for release on the next version.