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

Ability to set custom TTL values for custom DNS records #2043

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ddavness
Copy link
Contributor

@ddavness ddavness commented Sep 28, 2021

This commit was cherry-picked from a fork of mine, it might be useful for some folks - specifically those who are relying on Dynamic DNS where the TTL of 1 day might be inappropriate.

From ddavness/power-mailinabox#28:

  • The TTL value can be omitted by the user - in which case it takes the default TTL of 1 day
  • The TTL can be anywhere between 30 seconds and 30 days (2592000 seconds). These limits are enforced silently.
  • Records generated by the box will always have the default TTL value

@nomandera
Copy link
Contributor

I did not know I needed this until i reviewed (but did not test) this PR. Nice work.

30 seconds seems a sane lower bound however is it perhaps unnecessary. Would a simple warning text be as powerful and leave operators free to deploy one second (ephemeral) DNS records

@ddavness
Copy link
Contributor Author

The rationale is to save users from themselves. A TTL of 1 second is weird in the sense that should the resolver take a little longer to respond, by the time the answer is returned it already expired.

Plus, some DNS resolvers will likely not honor such low TTL values anyway.

On the other hand, are there use cases for 1-second-TTL use cases where a 30 second TTL wouldn't be just as fine?

@ddavness ddavness marked this pull request as ready for review October 2, 2021 20:34
@ddavness
Copy link
Contributor Author

ddavness commented Oct 2, 2021

This should be good to go and to be merged :)

Warning to folks that will be testing the PR: Before testing, keep a backup of /home/user-data/dns/custom.yaml somewhere (because this PR can write to the file in a non-backward compatible way). If you need to go back to the main branch, and custom DNS becomes broken, just restore the backup file.

@ddavness
Copy link
Contributor Author

ddavness commented Oct 4, 2021

@JoshData feel free to take a look :)

@raccettura
Copy link

Boy I love open source.

I was considering moving some domains to use mail-in-a-box for DNS, and tonight while testing the functionality realized the lack of TTL control was a dealbreaker. So no can do unless this gets addressed.

Traditionally TTL's tend to bottom out around 5 seconds, which is essentially "this changes virtually every request". I could see a use for that if updating a DNS record by API to direct traffic to the appropriate backend. Most people doing this kind of stuff are setting up their own DNS when you've got this kind of scale, but I wouldn't consider it useless. The API in mail-in-a-box is surprisingly good.

@jcm-shove-it
Copy link
Contributor

Easily possible to merge this into v60.1. Tested (short time) and works fine.

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

Successfully merging this pull request may close these issues.

None yet

4 participants