Skip to content

Conversation

@bwitt
Copy link
Contributor

@bwitt bwitt commented Nov 29, 2025

Pull Request (PR) description

Add support for reconfiguration via DNS SRV records.

  • add new dnssrv type
  • creates a script file, which queries SRV records
  • runs script via systemd timer

This Pull Request (PR) fixes the following issues

Fixes #131


### Use DNS Service records for dynamic NTP configuration

You can configure chrony to use DNS Service records for dynamic NTP server discovery.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL. Didn't know chrony supports this.

@bastelfreak bastelfreak added the enhancement New feature or request label Nov 29, 2025
$safe_name = regsubst($srv_record, '[^a-zA-Z0-9_-]', '_', 'G')
# Use actual srv_record for filenames
$sources_file = "${sourcedir}/${srv_record}.sources"
$script_file = "${sourcedir}/${srv_record}.sh"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this will be executable on systems with SELinux enforcing (EL variants).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what can we do about that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose an acceptance test would be the way, but that might be a lot of work. I guess someone who actually uses this feature on SELinux could figure it out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could probably set seltype on the file, and have an acceptance test that sets this up using the .invalid TLD, then run the script. The lookup will fail, but the script should succeed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the acceptance test is worth it. Maybe seltype would be enough?

@bwitt bwitt requested a review from kenyon November 29, 2025 16:58
@bwitt bwitt force-pushed the add_srv_records branch 2 times, most recently from cd84716 to a6b0ad4 Compare November 29, 2025 18:26
@bwitt bwitt requested a review from kenyon November 30, 2025 23:13
Copy link
Member

@kenyon kenyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some removal of redundant comments where the code is self-explanatory.

@bwitt bwitt requested a review from kenyon December 1, 2025 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for DNS Service record configuration

3 participants