diff --git a/zone-to-zonefile.nix b/zone-to-zonefile.nix index 35cdd4a..0c40d79 100644 --- a/zone-to-zonefile.nix +++ b/zone-to-zonefile.nix @@ -57,9 +57,9 @@ let isNotNull = o: !isNull o; hostToFqdn = host: - if isNotNull (builtins.match ".+\\.$" host) then + if isNotNull (builtins.match "[^.]+\\.$" host) then host - else if isNotNull (builtins.match ".+\\..+$" host) then + else if isNotNull (builtins.match "[^.]+\\[^.]+$" host) then "${host}." else if (hasAttr host zone.hosts) then "${host}.${domain}."