ctxis / SnitchDNS

Database Driven DNS Server with a Web UI

Home Page:https://www.contextis.com/en/resources/tools/snitchdns

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clearing the database?

rwjack opened this issue · comments

Hey, so I just wanted to check in on an opinion.
This is how my DB looks after 2 weeks of use:

image

This made me think - performance/storage related - if maybe there should be an option for pruning the DB of entries older than N (days,months,years) in the web-ui, with some sort of checkbox even for automatic pruning.


Also another question about caching - Is it actually implemented since in the docs i notice:
https://github.com/ctxis/SnitchDNS#limitations

Caching has not been implemented, which means this isn't suitable for environments with hundreds of DNS requests per minute.

But in the web-ui there is an option for caching:
image

If it is actually implemented, I'm guessing 0 stands for infinite? Is then there a time limit for how long it keeps the cache or?

I've implemented a "clear database after X number of days" option in the DNS settings - give it a try and let me know how it goes. It should run in the cron and most likely the first run will take a while as it'd delete the most records.

As for caching, true - I forgot to remove that text and have replaced it with another warning (single threaded). The caching mechanism currently implemented isn't very sophisticated, it's a simple array in-memory which is checked before the daemon checks the database. This means that if the max dns cached items is zero (disabled), the memory will keep growing and growing, so my recommendation would be to set it to something sensible (depending on your traffic and memory). Every time it hits that limit, the whole cache is emptied.

Let me know if the db cleanup doesn't work, otherwise I'll close this ticket.

I love the way you treat github like jira. You're an absolute legend.

Have you thought about having a potential method of accepting donations? I'm not exactly Bill Gates but a coffee would be the least I could do!

Thank you for your kind words but no donations are necessary! I'm just glad when people find SnitchDNS useful.

And as always, if you have any ideas feel free to create an issue!

Hi, for me the DB cleanup doesn't work. Thanks for your work.

Hi,

A couple of questions:

  1. Are you running SnitchDNS via Docker or a manual installation?
  2. Can you check if the cron is installed and running?

Thanks,
Pavel

Hi,

  1. via docker
  2. by running cron -l, I can see a job for flask crontab run.

Thanks

I think it's because the cron service wasn't starting - I've pushed c9314fc - could you try again with the latest and greatest version please?