From 3be1bc9336fad8b4f9f77c1f440be16957bc4b96 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 5 Mar 2023 23:50:50 +0100 Subject: [PATCH] cluster/services/dns: register with consul --- cluster/services/dns/authoritative.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cluster/services/dns/authoritative.nix b/cluster/services/dns/authoritative.nix index 8bfe4a1..8e8243f 100644 --- a/cluster/services/dns/authoritative.nix +++ b/cluster/services/dns/authoritative.nix @@ -61,4 +61,17 @@ in { systemd.services.coredns = { after = [ "pdns.service" ]; }; + + consul.services.pdns = { + mode = "external"; + definition.service = { + name = "authoritative-dns-backend"; + address = config.links.localAuthoritativeDNS.ipv4; + port = config.links.localAuthoritativeDNS.port; + checks = lib.singleton { + interval = "60s"; + tcp = config.links.localAuthoritativeDNS.tuple; + }; + }; + }; }