summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-29 09:10:26 +0200
committerPaul Buetow <paul@buetow.org>2026-01-29 09:10:26 +0200
commitc23537c8a55c101588d13de5e965b056b5012a4f (patch)
treef7714691c0231e890acb64372132b89b26e8e687 /frontends
parent0a973372d58d12cc1b1a756f6acf0473279b95b2 (diff)
Smart A/AAAA record generation for ipv4/ipv6 only hosts
Amp-Thread-ID: https://ampcode.com/threads/T-019c086d-c760-779d-b740-0f748094b62a Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'frontends')
-rw-r--r--frontends/var/nsd/zones/master/buetow.org.zone.tpl19
1 files changed, 10 insertions, 9 deletions
diff --git a/frontends/var/nsd/zones/master/buetow.org.zone.tpl b/frontends/var/nsd/zones/master/buetow.org.zone.tpl
index 27f5bc9..03dabb1 100644
--- a/frontends/var/nsd/zones/master/buetow.org.zone.tpl
+++ b/frontends/var/nsd/zones/master/buetow.org.zone.tpl
@@ -54,20 +54,21 @@ www.tmp 300 IN AAAA <%= $ips->{current_master}{ipv6} %> ; Enable failover
standby.tmp 300 IN A <%= $ips->{current_standby}{ipv4} %> ; Enable failover
standby.tmp 300 IN AAAA <%= $ips->{current_standby}{ipv6} %> ; Enable failover
-<% for my $host (@$f3s_hosts) { -%>
+<% for my $host (@$f3s_hosts) {
+ my $is_ipv6_only = $host =~ /^ipv6\./;
+ my $is_ipv4_only = $host =~ /^ipv4\./;
+-%>
+<% unless ($is_ipv6_only) { -%>
<%= $host %>. 300 IN A <%= $ips->{current_master}{ipv4} %> ; Enable failover
-<%= $host %>. 300 IN AAAA <%= $ips->{current_master}{ipv6} %> ; Enable failover
www.<%= $host %>. 300 IN A <%= $ips->{current_master}{ipv4} %> ; Enable failover
-www.<%= $host %>. 300 IN AAAA <%= $ips->{current_master}{ipv6} %> ; Enable failover
standby.<%= $host %>. 300 IN A <%= $ips->{current_standby}{ipv4} %> ; Enable failover
+<% } -%>
+<% unless ($is_ipv4_only) { -%>
+<%= $host %>. 300 IN AAAA <%= $ips->{current_master}{ipv6} %> ; Enable failover
+www.<%= $host %>. 300 IN AAAA <%= $ips->{current_master}{ipv6} %> ; Enable failover
standby.<%= $host %>. 300 IN AAAA <%= $ips->{current_standby}{ipv6} %> ; Enable failover
<% } -%>
-
-; ipv6test stuff
-ipv4.ipv6test.f3s 300 IN A <%= $ips->{current_master}{ipv4} %> ; Enable failover
-ipv6.ipv6test.f3s 300 IN AAAA <%= $ips->{current_master}{ipv6} %> ; Enable failover
-standby.ipv4.ipv6test.f3s 300 IN A <%= $ips->{urrent_standby{ipv4} %> ; Enable failover
-standby.ipv6.ipv6test.f3s 300 IN AAAA <%= $ips->{urrent_standby{ipv6} %> ; Enable failover
+<% } -%>
; So joern can directly preview the content before rsync happens from blowfish to fishfinger
joern IN CNAME blowfish