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

Add trailing dot to cnames #15

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 2024-05-06
If you use CNAMEs a trailing dot will now be added automatically.
This behavior is in line with other record types that use dns names.

This breaks using subdomain paths in CNAMEs and if you are using full domain names
in CNAMEs you will need to remove the trailing dot in your config.

`zones."example.org"."example".cname.data = "example2"`-> `example.example.org IN CNAME example2.`
You will now have to write it as:
`zones."example.org"."example".cname.data = "example2.example.org"`-> `example.example.org IN CNAME example2.example.org.`
2 changes: 1 addition & 1 deletion modules/records.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ lib.mapAttrs
'';
example = "foo.example.com";
type = with lib.types; nullOr str; # change str to lib.types.domain once it exists
apply = x: if x != null then lib.toList x else x;
apply = x: if x != null then lib.toList "${x}." else x;
};
sub = {
apply = lib.toList;
Expand Down
Loading