From b60a1cd5a255037e3f2487dcb7e30858ca93ae75 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 2 Nov 2023 23:58:49 +0100 Subject: [PATCH] cluster/services/dns: fix regex handling --- cluster/services/dns/authoritative.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/services/dns/authoritative.nix b/cluster/services/dns/authoritative.nix index 57f65ee..111d85d 100644 --- a/cluster/services/dns/authoritative.nix +++ b/cluster/services/dns/authoritative.nix @@ -20,7 +20,7 @@ let rewriteRecords = lib.filterAttrs (_: record: record.rewrite.target != null) cluster.config.dns.records; rewrites = lib.mapAttrsToList (_: record: let - maybeEscapeRegex = str: if record.rewrite.type == "regex" then "^${lib.escapeRegex str}$" else str; + maybeEscapeRegex = str: if record.rewrite.type == "regex" then "${lib.escapeRegex str}$" else str; in "rewrite stop name ${record.rewrite.type} ${record.name}${maybeEscapeRegex ".${record.root}."} ${record.rewrite.target}. answer auto") rewriteRecords; rewriteConf = pkgs.writeText "coredns-rewrites.conf" (lib.concatStringsSep "\n" rewrites);