Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting max-cache-ttl to 0 causes slowdown problems #137

Open
markkundinger opened this issue Jul 16, 2023 · 4 comments
Open

setting max-cache-ttl to 0 causes slowdown problems #137

markkundinger opened this issue Jul 16, 2023 · 4 comments
Labels

Comments

@markkundinger
Copy link

markkundinger commented Jul 16, 2023

Describe the issue you are having

with the change from last that set max-cache-ttl to 0, the lancache DNS service is now quite slow. each lookup can take one or two full seconds, and subsequent checks are not cached at all so they also take a second or two. Further more, even a downstream pihole will not cache the hits because the TTL was set to zero.

The change was made with commit #131

of the three changes to the options file:
'forward-only' seems fine, and it accomplishes the goal of that commit.
'max-ncache-ttl' doesn't seem to break anything, although the default bind value is 10800
'max-cache-ttl' of 0 is the problem. Per the docs, the default value is 604800, and zero should not be used because it may cause SERVFAIL errors.

https://bind9.readthedocs.io/en/latest/reference.html#namedconf-statement-max-ncache-ttl

I've personally modified it to 10,000 and it works well.

my recommendation is to leave in the forward only line and strip out the other two. (barring an enhancement to let the user set the cache values)

How are you running the container(s)

docker compose, pulled latest.


### DNS Configuration

version: '2.1'

services:
dns:
image: lancachenet/lancache-dns:latest
env_file: .env

restart: unless-stopped

ports:
  - ${DNS_BIND_IP}:53:53/udp
  - ${DNS_BIND_IP}:53:53/tcp

and in .env

IP address on the host that the DNS server should bind to

DNS_BIND_IP=192.168.3.204

DNS Resolution for forwarded DNS lookups

UPSTREAM_DNS=149.112.112.11;9.9.9.11


### Output of container(s)

I have nothing.

@lmginfra
Copy link

lmginfra commented Aug 4, 2023

yeah would be really nice to have it configurable via env variable. +1

@VibroAxe
Copy link
Member

VibroAxe commented Aug 7, 2023

@MathewBurnett ?

@AranVink
Copy link

+1 for making this configurable.

I also found this one while doing some testing.
What I don't get is this is not just for the content domains that are 'poisoned'/'enriched' for caching, it's for all of them. I can imagine the content domains have to have a low TTL to ensure traffic is captured quickly, but for regular domains this really slows down normal internet/browsing tasks. Having this set makes any client OS level DNS caching worthless AFAIK.

If I find some time next week I will create a PR for this :)

Copy link

stale bot commented Mar 17, 2024

This issue has been automatically marked as inactive because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the inactive label Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants