chiark / gitweb /
distorted.lisp: Better processing of anycast addresses.
[zones] / distorted.lisp
CommitLineData
e80b4c2d
MW
1;;; Zone file for distorted.org.uk
2
b4d4c18b 3(load "hosts.lisp" :verbose nil)
e80b4c2d 4
b1d5c6c2 5;;;--------------------------------------------------------------------------
aef7892b
MW
6;;; Anycast services.
7
8(defvar *anycast-routable-families* (list :ipv6))
9
10(defzoneparse :anycast (name data rec :prefix prefix :zname zname)
11 (destructuring-bind (any-provider default-provider &rest other-providers)
12 data
13
14 ;; First, the default address. If the anycast network is preferred then
15 ;; this is easy; otherwise we have something complicated to do because
16 ;; IPv6 anycast addresses are globally routable, while IPv4 ones aren't.
17 (if (zone-preferred-subnet-p (car any-provider))
18 (zone-set-address #'rec (cdr any-provider) :make-ptr-p t)
19 (dolist (addr (host-addrs (host-parse (cdr any-provider))))
20 (let ((family (ipaddr-family addr)))
21 (if (member family *anycast-routable-families*)
22 (zone-set-address #'rec addr
23 :family family :make-ptr-p t)
24 (zone-set-address #'rec (cdr default-provider)
25 :family family :make-ptr-p nil)))))
26
27 ;; Now for all of the others.
28 (dolist (provider (list* any-provider default-provider other-providers))
29 (zone-set-address #'rec (cdr provider)
30 :make-ptr-p (eq provider any-provider)
31 :name (concatenate 'string prefix "."
32 (string-downcase (car provider))
33 "." (string-downcase zname))))))
34
35;;;--------------------------------------------------------------------------
b1d5c6c2 36;;; Other definitions.
e80b4c2d
MW
37
38(setf *default-zone-admin* "hostmaster@distorted.org.uk")
2bc217e8 39
ff6c53ad 40(setf *default-zone-source* 'radius.distorted.org.uk.)
e80b4c2d 41
b1d5c6c2
MW
42;;;--------------------------------------------------------------------------
43;;; Main zone definition.
44
e80b4c2d 45(defzone distorted.org.uk
ec4898f9 46
6ef39f28 47 ;; Nameservers.
ff6c53ad 48 :ns #+view/inside ((radius.ns :ip radius)
f0209b9c 49 (precision.ns :ip precision)
ff6c53ad
MW
50 (vampire.ns :ip vampire))
51 #-view/inside ((radius.ns :ip radius)
f0209b9c 52 (precision.ns :ip precision)
ff6c53ad 53 (mythic-beasts-1.ns :ip mythic-ns1)
4a487d58 54 (mythic-beasts-2.ns :ip mythic-ns2)
ff6c53ad 55 (chiark.ns :ip chiark.greenend.org.uk))
ec4898f9 56
6ef39f28 57 ;; Mail servers.
39567ec1 58 ((@ mail)
96c2a692
MW
59 :mx mail
60 :srv ((:smtp mail)))
39567ec1
MW
61 ((lists bugs cryptomail)
62 :ttl 300
63 :mx mail
64 :srv ((:smtp old-mail)))
ec4898f9 65
69bbb181 66 (stratocaster.20140403._domainkey
8d261a89
MW
67 :dkim ("stratocaster-20140403"
68 :v "DKIM1" :k "rsa" :h "sha256" :s "email"))
69bbb181 69
06f1bb3f 70 ;; Anycast services.
aef7892b
MW
71 (dns0 :anycast ((any dns0.any)
72 (jump precision.jump)
73 (colo precision.colo)
74 (dmz radius.dmz)
75 (unsafe radius.unsafe)))
76 (dns1 :anycast ((any dns1.any)
77 (jump telecaster.jump)
78 (dmz vampire.dmz)
79 (unsafe vampire.unsafe)
80 (colo telecaster.colo)))
cfecfa5c
MW
81 (dns :cname dns0)
82
aef7892b
MW
83 (ntp0 :anycast ((any ntp0.any)
84 (jump fender.jump)
85 (dmz ibanez.dmz)
86 (unsafe ibanez.unsafe)
87 (colo fender.colo)))
88 (ntp1 :anycast ((any ntp1.any)
89 (dmz vampire.dmz)
90 (unsafe vampire.unsafe)))
cfecfa5c
MW
91 (ntp :cname ntp0)
92
aef7892b
MW
93 (www-cache :anycast ((any www-cache.any)
94 (jump telecaster.jump)
95 (dmz roadstar.dmz)
96 (unsafe roadstar.unsafe)
97 (colo telecaster.colo)))
345c0f69
MW
98 (wpad :cname www-cache)
99
cfecfa5c 100 (_kerberos :txt "DISTORTED.ORG.UK")
aef7892b
MW
101 (krb0 :anycast ((any krb0.any)
102 (jump precision.jump)
103 (dmz radius.dmz)
104 (unsafe radius.unsafe)
105 (colo precision.colo)))
106 (krb1 :anycast ((any krb1.any)
107 (dmz vampire.dmz)
108 (unsafe vampire.unsafe)))
cfecfa5c
MW
109 (krb-master (unsafe :svc radius.unsafe)
110 (dmz :svc radius.dmz))
111 :srv (((:kerberos :protocol :udp)
112 krb0
113 (krb1 :prio 100))
114 ((:kerberos-master :protocol :udp :port 88) krb-master)
115 (:kerberos-adm krb-master)
116 ((:kpasswd :protocol :udp) krb-master))
117 (krb :cname krb0)
118
6ef39f28 119 ;; Other services.
96c2a692
MW
120 :srv ((:http www)
121 (:ftp ftp))
ec4898f9 122
92e99247 123 ;; Entry is via little router box.
ff6c53ad 124 (dmz :net dmz)
0fa108c4 125 (guvnor (dmz :a guvnor.dmz))
ff6c53ad
MW
126 (gate (dmz :a gate.dmz))
127 (nat (dmz :a nat.dmz))
ec4898f9 128
6ef39f28 129 ;; Wireless gateway.
ff6c53ad 130 (wireless :net wireless)
d8536712 131 (evolution (safe :a evolution.safe))
9c43df2a 132 (evolution :alias evo)
ec4898f9 133
4c25329e 134 ;; Colocated services.
8d261a89
MW
135 ((irc vox) (colo :svc jazz.colo :sshfp "jazz")
136 (jump :svc jazz.jump :sshfp "jazz"))
137 ((git www mail) (colo :svc stratocaster.colo :sshfp "stratocaster")
138 (jump :svc stratocaster.jump :sshfp "stratocaster"))
d13943aa
MW
139 :svc #+view/inside stratocaster.colo
140 #-view/inside stratocaster.jump
8d261a89
MW
141 (cabal :svc stratocaster.colo :sshfp "stratocaster")
142 ((db ftp) (colo :svc telecaster.colo :sshfp "telecaster")
143 (jump :svc telecaster.jump :sshfp "telecaster"))
4c25329e 144
6ef39f28 145 ;; Local services.
6c719992
MW
146 ((rawk pifi) (unsafe :svc artist.unsafe)
147 (dmz :svc artist.dmz))
8d261a89
MW
148 (mirror (dmz :svc roadstar.dmz :sshfp "roadstar")
149 (unsafe :svc roadstar.unsafe :sshfp "roadstar"))
150 ((wiki bugs old-mail i2p) :svc vampire :sshfp "vampire")
ec4898f9 151
6ef39f28 152 ;; Internal services.
8d261a89 153 #+view/inside ((news lpr) :svc vampire.unsafe :sshfp "vampire")
ec4898f9 154
04db9729 155 ;; Anonymity services.
0865ffd5 156 (anon (colo :svc jazz.colo)
f99b371f
MW
157 (unsafe :svc vampire.unsafe)
158 (jump :a anon.jump)
0865ffd5 159 (dmz :a anon.dmz))
04db9729 160
85a3496c 161 ;; Fancy connectivity.
17c95de9 162 (iodine (jump :a jazz.jump))
85a3496c 163
38c2de7c
MW
164 ;; Colocated hosts.
165 (colo :net colo)
166 (jump :net jump)
8d261a89
MW
167 (fender (colo :a fender.colo :sshfp "fender")
168 (jump :a fender.jump :sshfp "fender"))
169 (precision (colo :a precision.colo :sshfp "precision")
170 (jump :a precision.jump :sshfp "precision"))
171 (telecaster (colo :a telecaster.colo :sshfp "telecaster")
172 (jump :a telecaster.jump :sshfp "telecaster"))
38c2de7c 173 (telecaster :alias tele)
8d261a89
MW
174 (stratocaster (colo :a stratocaster.colo :sshfp "stratocaster")
175 (jump :a stratocaster.jump :sshfp "stratocaster"))
38c2de7c 176 (stratocaster :alias strat)
8d261a89
MW
177 (jazz (colo :a jazz.colo :sshfp "jazz")
178 (jump :a jazz.jump :sshfp "jazz")
179 (iodine :a jazz.iodine :sshfp "jazz"))
38c2de7c 180
4a372d1b
MW
181 ;; Media server (on loan to Good Technology HSTG).
182 (jaguar (jump :a jaguar.jump))
183
a20ec58c
MW
184 ;; Nicko's server.
185 (richmond (jump :a richmond.jump))
186
6ef39f28 187 ;; Wired ethernet.
04d65182
MW
188 (unsafe :net unsafe)
189 (safe :net safe)
190 (untrusted :net untrusted)
8d261a89
MW
191 (vampire (unsafe :a vampire.unsafe :sshfp "vampire")
192 (dmz :a vampire.dmz :sshfp "vampire")
193 (safe :a vampire.safe :sshfp "vampire")
194 (untrusted :a vampire.untrusted :sshfp "vampire"))
195 (ibanez (unsafe :a ibanez.unsafe :sshfp "ibanez")
196 (dmz :a ibanez.dmz :sshfp "ibanez"))
197 (radius (unsafe :a radius.unsafe :sshfp "radius")
198 (dmz :a radius.dmz :sshfp "radius")
199 (safe :a radius.safe :sshfp "radius")
200 (untrusted :a radius.untrusted :sshfp "radius"))
201 (roadstar (unsafe :a roadstar.unsafe :sshfp "roadstar")
202 (dmz :a roadstar.dmz :sshfp "roadstar"))
203 (jem (unsafe :a jem.unsafe :sshfp "jem")
204 (dmz :a jem.dmz :sshfp "jem"))
205 (artist (unsafe :a artist.unsafe :sshfp "artist")
206 (dmz :a artist.dmz :sshfp "artist")
207 (untrusted :a artist.untrusted :sshfp "artist"))
ec4898f9 208
ff6c53ad 209 ;; DHCP hosts.
4b5e05ad
MW
210 (gibson :cname gibson.dhcp)
211 (lespaul :cname lespaul.dhcp)
212 (firebird :cname firebird.dhcp)
aa4d55b1
MW
213 (marauder :cname marauder.dhcp)
214 (invader :cname invader.dhcp)
ec4898f9 215
6ef39f28 216 ;; Virtual network.
374be896 217 (vpn :net vpn)
8d261a89
MW
218 (crybaby (vpn :a crybaby.vpn :sshfp "crybaby"))
219 (terror (vpn :a terror.vpn :sshfp "terror"))
220 (orange (vpn :a orange.vpn :sshfp "orange"))
fc0ce2ed 221 (iodine :net iodine)
ec4898f9 222
6ef39f28 223 ;; ITS.
b1d5c6c2 224 (its :net its)
ff6c53ad
MW
225 (gw (its :a gw.its))
226 (mz (its :a mz.its))
ec4898f9 227
c2118713
MW
228 ;; Strange things.
229 (blackhole (jump :a blackhole.jump))
230
6ef39f28 231 ;; Delegations.
f0209b9c
MW
232 (dhcp :ns ((radius.ns.dhcp :ip radius)
233 (precision.ns.dhcp :ip precision)
234 (vampire.ns.dhcp :ip vampire)))
49c5f8ff
MW
235 (dyn :ns ((radius.ns.dyn :ip radius)
236 (precision.ns.dyn :ip precision)
237 (vampire.ns.dyn :ip vampire)))
0262908f 238 (dnserr :ns ((radius.ns.dnserr :ip radius.dmz)
f0209b9c 239 (precision.ns.dnserr :ip precision.jump)
0262908f 240 (vampire.ns.dnserr :ip vampire.dmz)))
17c95de9 241 (io :ns ((ns.io :ip jazz.jump))))
b1d5c6c2
MW
242
243;;;--------------------------------------------------------------------------
244;;; Other subsidiary zones.
e80b4c2d
MW
245
246(defrevzone trusted
ff6c53ad 247 :ns ((radius.ns :ip radius)
f0209b9c 248 (precision.ns :ip precision)
ff6c53ad 249 (vampire.ns :ip vampire))
b59ce50d
MW
250 :reverse unsafe
251 :reverse vpn
252 :reverse colo
253 :reverse its
345c0f69 254 :reverse any
f0209b9c
MW
255 (dhcp :ns ((radius.ns.dhcp :ip radius)
256 (precision.ns.dhcp :ip precision)
257 (vampire.ns.dhcp :ip vampire)))
3503589d 258 :multi (((dhcp safe) :family :ipv4 :suffix "199.29.172.dhcp") :cname *))
b3f75214 259
ff6c53ad
MW
260(defrevzone dmz
261 :ns ((radius.ns :ip radius)
f0209b9c 262 (precision.ns :ip precision)
ff6c53ad
MW
263 (vampire.ns :ip vampire))
264 :reverse dmz)
92e99247 265
38c2de7c
MW
266(defrevzone jump
267 :ns ((radius.ns :ip radius)
f0209b9c 268 (precision.ns :ip precision)
38c2de7c
MW
269 (vampire.ns :ip vampire))
270 :reverse jump)
271
995d75b4 272(defzone io.distorted.org.uk
17c95de9 273 :ns ((ns :ip jazz.jump))
995d75b4
MW
274 (about :txt "Fake zone used for IP-over-DNS tunnelling."))
275
b1d5c6c2 276;;;----- That's all, folks --------------------------------------------------