Automatically install and configure DNS root hints #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here is a possible solution to issue #7 about not having root hints available. I tried to copy the existing patterns as much as possible.
This patch relies on the use of
exec
to download the latest root hints from IANA. I think it's reasonable to assume that a DNS server has curl available and can contact the IANA webserver. The exec runs only if the hints file is missing, which is normally only on the first run.Originally I was going to add extra parameters for customization, but I ended up keeping it simple after running into a couple problems:
/etc
directory. There isn't really any reason for somebody to customize the path to the root hints file.requires
dependency correctly with thecron
resource wrapped inside anif {}
statement. Maybe thebefore
metaparameter would work better?cron
resource that would update the root hints file, but I don't know of an elegant way to avoid the "thundering herd" problem that would result in a lot of simultaneous queries to the root hints servers if many servers were using this module.