Skip to content

Commit 8d5b5cf

Browse files
committed
dns-server: Add current and new XMPP zones.
Those zones currently are only for transition/preparation to switch to the new deployment. Note here, that the old XMPP server is "merkelig", which has four IPv4 addresses: * 88.198.198.218 -> aszlig.net * 88.198.198.219 -> headcounter.org * 88.198.198.220 -> no-icq.org * 88.198.198.221 -> noicq.org Unfortunately it only has *one* IPv6 address (2001:6f8:900:72a::2) using a SixXS tunnel, which is going to be changed for our new deployment as well but is kept here to ensure we don't introduce any additional false positives when debugging. Also note, that we now need two new GLUE records for ns1.headcounter.org and ns2.headcounter.org. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
1 parent 919e8a6 commit 8d5b5cf

1 file changed

Lines changed: 115 additions & 0 deletions

File tree

dns-server.nix

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,122 @@
1+
{ lib, ... }:
2+
13
{
24
deployment.hetzner.partitions = ''
35
clearpart --all --initlabel --drives=vda
46
part swap --size=2000 --label=swap --fstype=swap --ondisk=vda
57
part / --fstype=ext4 --label=root --grow --ondisk=vda
68
'';
9+
10+
services.nsd = let
11+
primaryDNS = "ns1.headcounter.org";
12+
secondaryDNS = "ns2.headcounter.org";
13+
14+
mkSOA = dottedEmail: ''
15+
@ IN SOA ${primaryDNS}. ${dottedEmail}. (
16+
1000 ; Serial
17+
28800 ; Refresh
18+
7200 ; Retry
19+
604800 ; Expire
20+
86400 ; Negative Cache TTL
21+
)
22+
'';
23+
24+
mkZone = domain: text: ''
25+
\$ORIGIN ${domain}.
26+
\$TTL 3600 ; 1 hour
27+
${mkSOA "postmaster.${domain}"}
28+
@ IN NS ${primaryDNS}.
29+
@ IN NS ${secondaryDNS}.
30+
@ IN MX 10 mailfresser.de.
31+
32+
${text}
33+
'';
34+
35+
mkXMPPRecords = dest: ''
36+
conference IN CNAME ${dest}
37+
irc IN CNAME ${dest}
38+
pubsub IN CNAME ${dest}
39+
vjud IN CNAME ${dest}
40+
icq IN CNAME ${dest}
41+
aim IN CNAME ${dest}
42+
msn IN CNAME ${dest}
43+
yahoo IN CNAME ${dest}
44+
mail IN CNAME ${dest}
45+
jmc IN CNAME ${dest}
46+
gadugadu IN CNAME ${dest}
47+
sms IN CNAME ${dest}
48+
proxy IN CNAME ${dest}
49+
50+
_jabber._tcp IN SRV 10 0 5269 ${dest}
51+
_xmpp-server._tcp IN SRV 10 0 5269 ${dest}
52+
_xmpp-client._tcp IN SRV 10 0 5222 ${dest}
53+
'';
54+
55+
in {
56+
enable = true;
57+
interfaces = lib.mkForce []; # all interfaces
58+
zones = {
59+
"aszlig.net.".data = mkZone "aszlig.net" ''
60+
; Generic stuff
61+
@ IN A 88.198.198.218
62+
@ IN AAAA 2001:6f8:900:72a::2
63+
jabber IN A 88.198.43.4
64+
65+
; Legacy DNS servers
66+
ns1 IN A 85.10.206.212
67+
ns2 IN A 217.20.112.88
68+
69+
; @ is legacy server
70+
${mkXMPPRecords "@"}
71+
'';
72+
73+
"headcounter.org.".data = mkZone "headcounter.org" ''
74+
; Hosts of the new deployment
75+
taalo IN A 144.76.61.117
76+
benteflork IN A 144.76.202.147
77+
ultron IN A 5.9.105.142
78+
79+
; DNS servers
80+
ns1 IN A 78.46.182.124
81+
ns1 IN AAAA 2a01:4f8:d13:3009::1
82+
ns2 IN A 78.47.142.38
83+
ns2 IN AAAA 2a01:4f8:d13:5308::1
84+
85+
; Legacy transition stuff
86+
@ IN A 78.47.32.129
87+
@ IN AAAA 2a01:4f8:162:4187::1
88+
merkelig IN A 88.198.198.219
89+
merkelig IN AAAA 2001:6f8:900:72a::2
90+
jabber IN A 88.198.43.4
91+
jabber IN AAAA 2001:6f8:900:72a::2
92+
www IN A 88.198.43.4
93+
www IN AAAA 2001:6f8:900:72a::2
94+
95+
; "merkelig" is legacy server
96+
${mkXMPPRecords "merkelig"}
97+
'';
98+
99+
"no-icq.org.".data = mkZone "no-icq.org" ''
100+
; Generic stuff
101+
@ IN A 88.198.198.220
102+
@ IN AAAA 2001:6f8:900:72a::2
103+
jabber IN A 88.198.43.4
104+
www IN A 88.198.43.4
105+
106+
; @ is legacy server
107+
${mkXMPPRecords "@"}
108+
'';
109+
110+
"noicq.org.".data = mkZone "noicq.org" ''
111+
; Generic stuff
112+
@ IN A 88.198.198.221
113+
@ IN AAAA 2001:6f8:900:72a::2
114+
jabber IN A 88.198.43.4
115+
www IN A 88.198.43.4
116+
117+
; @ is legacy server
118+
${mkXMPPRecords "@"}
119+
'';
120+
};
121+
};
7122
}

0 commit comments

Comments
 (0)