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

Handle TTL for blocked queries seperately #1173

Merged
merged 1 commit into from Sep 25, 2021
Merged

Handle TTL for blocked queries seperately #1173

merged 1 commit into from Sep 25, 2021

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Sep 24, 2021

By submitting this pull request, I confirm the following:

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

How familiar are you with the codebase?:

10


So far, we used local-ttl=2 hard-coded in dnsmasq's config because this ensured clients won't cache blocked queries for longer times, possibly rendering whitelisting ineffective.

This PR implements a new TTL for blocked queries only. This allows users to set local-ttl to any value they prefer without this being overwritten in 01-pihole.conf after each update. This seems useful in context of locally used hostnames that are known to stay constant over long times (e.g., printers, etc.).

The new value defaults to 2 seconds (no change in behavior) and can be controlled using the new FTL config option BLOCK_TTL=2

…g in dnsmasq's config.

Signed-off-by: DL6ER <dl6er@dl6er.de>
@dschaper dschaper self-requested a review September 25, 2021 19:35
@DL6ER DL6ER merged commit df276f6 into development Sep 25, 2021
@DL6ER DL6ER deleted the new/BLOCK_TTL branch September 25, 2021 19:56
@yubiuser
Copy link
Member

Documentation needed.

@DL6ER
Copy link
Member Author

DL6ER commented Sep 27, 2021

See pi-hole/docs@60195ea in pi-hole/docs#573

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/change-default-blacklist-ttl-via-environment-variables/48926/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants