chiark / gitweb /
distorted.lisp: Publish our standard abbreviated names in a subdomain.
[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)
6baf2de2 19 (do-host (addr (cdr any-provider))
aef7892b
MW
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)
c9f96590
MW
31 :name (domain-name-concat prefix
32 (zone-parse-host
33 (car provider)
34 zname))))))
aef7892b
MW
35
36;;;--------------------------------------------------------------------------
07fe1e43
MW
37;;; Hostname abbreviations.
38
39(defvar *abbrev-subdomain*
40 (make-domain-name :labels '("abbrev") :absolutep nil))
41(defparameter *abbrev-used* (make-hash-table :test #'equal))
42
43(defzoneparse :abbrev (name data rec :zname zname)
44 (let* ((domain (zone-parse-host data
45 (domain-name-concat *abbrev-subdomain*
46 zname)))
47 (key (princ-to-string domain))
48 (existing (gethash key *abbrev-used*)))
49 (when existing
50 (error "Abbrev collision for ~A between ~A and ~A."
51 domain existing name))
52 (setf (gethash key *abbrev-used*) name)
53 (rec :name domain
54 :type :cname
55 :data name)))
56
57;;;--------------------------------------------------------------------------
b1d5c6c2 58;;; Other definitions.
e80b4c2d
MW
59
60(setf *default-zone-admin* "hostmaster@distorted.org.uk")
2bc217e8 61
ff6c53ad 62(setf *default-zone-source* 'radius.distorted.org.uk.)
e80b4c2d 63
b1d5c6c2
MW
64;;;--------------------------------------------------------------------------
65;;; Main zone definition.
66
e80b4c2d 67(defzone distorted.org.uk
ec4898f9 68
6ef39f28 69 ;; Nameservers.
ff6c53ad 70 :ns #+view/inside ((radius.ns :ip radius)
f0209b9c 71 (precision.ns :ip precision)
1b9508ad 72 (telecaster.ns :ip telecaster)
ff6c53ad
MW
73 (vampire.ns :ip vampire))
74 #-view/inside ((radius.ns :ip radius)
f0209b9c 75 (precision.ns :ip precision)
1b9508ad 76 (telecaster.ns :ip telecaster)
ff6c53ad 77 (mythic-beasts-1.ns :ip mythic-ns1)
4a487d58 78 (mythic-beasts-2.ns :ip mythic-ns2)
ff6c53ad 79 (chiark.ns :ip chiark.greenend.org.uk))
ec4898f9 80
6ef39f28 81 ;; Mail servers.
cf079d8b 82 ((@ mail blackhole)
96c2a692
MW
83 :mx mail
84 :srv ((:smtp mail)))
39567ec1
MW
85 ((lists bugs cryptomail)
86 :ttl 300
87 :mx mail
88 :srv ((:smtp old-mail)))
ec4898f9 89
69bbb181 90 (stratocaster.20140403._domainkey
8d261a89
MW
91 :dkim ("stratocaster-20140403"
92 :v "DKIM1" :k "rsa" :h "sha256" :s "email"))
69bbb181 93
06f1bb3f 94 ;; Anycast services.
aef7892b
MW
95 (dns0 :anycast ((any dns0.any)
96 (jump precision.jump)
97 (colo precision.colo)
98 (dmz radius.dmz)
99 (unsafe radius.unsafe)))
100 (dns1 :anycast ((any dns1.any)
101 (jump telecaster.jump)
102 (dmz vampire.dmz)
103 (unsafe vampire.unsafe)
104 (colo telecaster.colo)))
cfecfa5c
MW
105 (dns :cname dns0)
106
aef7892b
MW
107 (ntp0 :anycast ((any ntp0.any)
108 (jump fender.jump)
109 (dmz ibanez.dmz)
110 (unsafe ibanez.unsafe)
111 (colo fender.colo)))
112 (ntp1 :anycast ((any ntp1.any)
113 (dmz vampire.dmz)
114 (unsafe vampire.unsafe)))
cfecfa5c
MW
115 (ntp :cname ntp0)
116
aef7892b 117 (www-cache :anycast ((any www-cache.any)
6fcf076f
MW
118 (jump telecaster.jump)
119 (dmz roadstar.dmz)
120 (unsafe roadstar.unsafe)
121 (colo telecaster.colo)))
345c0f69
MW
122 (wpad :cname www-cache)
123
cfecfa5c 124 (_kerberos :txt "DISTORTED.ORG.UK")
aef7892b
MW
125 (krb0 :anycast ((any krb0.any)
126 (jump precision.jump)
127 (dmz radius.dmz)
128 (unsafe radius.unsafe)
129 (colo precision.colo)))
130 (krb1 :anycast ((any krb1.any)
131 (dmz vampire.dmz)
132 (unsafe vampire.unsafe)))
cfecfa5c
MW
133 (krb-master (unsafe :svc radius.unsafe)
134 (dmz :svc radius.dmz))
135 :srv (((:kerberos :protocol :udp)
136 krb0
137 (krb1 :prio 100))
138 ((:kerberos-master :protocol :udp :port 88) krb-master)
139 (:kerberos-adm krb-master)
140 ((:kpasswd :protocol :udp) krb-master))
141 (krb :cname krb0)
142
6ef39f28 143 ;; Other services.
96c2a692
MW
144 :srv ((:http www)
145 (:ftp ftp))
ec4898f9 146
92e99247 147 ;; Entry is via little router box.
ff6c53ad 148 (dmz :net dmz)
c3997955 149 (guvnor (dmz :addr guvnor.dmz))
c3997955 150 (nat (dmz :addr nat.dmz))
ec4898f9 151
6ef39f28 152 ;; Wireless gateway.
ff6c53ad 153 (wireless :net wireless)
c3997955 154 (evolution (safe :addr evolution.safe))
9c43df2a 155 (evolution :alias evo)
ec4898f9 156
4c25329e 157 ;; Colocated services.
6e726a18
MW
158 ((irc vox keys) (colo :svc jazz.colo :sshfp "jazz")
159 (jump :svc jazz.jump :sshfp "jazz"))
8d261a89
MW
160 ((git www mail) (colo :svc stratocaster.colo :sshfp "stratocaster")
161 (jump :svc stratocaster.jump :sshfp "stratocaster"))
d9fb2838 162 ((www @) :tlsa (:https (:service-certificate-constraint
9ce2de9d 163 :certificate :sha-256 #p"http-server-www#1")))
d9fb2838 164 (git :tlsa (:https (:trust-anchor-assertion
9ce2de9d 165 :certificate :sha-256 #p"distorted-ca")))
d9fb2838 166 (www-cache :tlsa (3127 (:trust-anchor-assertion
9ce2de9d
MW
167 :certificate :sha-256 #p"distorted-ca")))
168 (mail :tlsa ((:smtp :submission :imap)
169 (:trust-anchor-assertion
170 :certificate :sha-256 #p"distorted-ca")))
d13943aa
MW
171 :svc #+view/inside stratocaster.colo
172 #-view/inside stratocaster.jump
8d261a89 173 (cabal :svc stratocaster.colo :sshfp "stratocaster")
0dccfb48
MW
174 ((db ftp) (colo :svc telecaster.colo :sshfp "telecaster")
175 (jump :svc telecaster.jump :sshfp "telecaster"))
176 (dyndns :svc telecaster.jump :sshfp "telecaster")
4c25329e 177
6ef39f28 178 ;; Local services.
6c719992
MW
179 ((rawk pifi) (unsafe :svc artist.unsafe)
180 (dmz :svc artist.dmz))
8d261a89
MW
181 (mirror (dmz :svc roadstar.dmz :sshfp "roadstar")
182 (unsafe :svc roadstar.unsafe :sshfp "roadstar"))
183 ((wiki bugs old-mail i2p) :svc vampire :sshfp "vampire")
ec4898f9 184
6ef39f28 185 ;; Internal services.
8d261a89 186 #+view/inside ((news lpr) :svc vampire.unsafe :sshfp "vampire")
ec4898f9 187
04db9729 188 ;; Anonymity services.
0865ffd5 189 (anon (colo :svc jazz.colo)
f99b371f 190 (unsafe :svc vampire.unsafe)
c3997955
MW
191 (jump :addr anon.jump)
192 (dmz :addr anon.dmz))
04db9729 193
85a3496c 194 ;; Fancy connectivity.
d267cd94 195 (iodine (jump :svc jazz.jump))
85a3496c 196
38c2de7c
MW
197 ;; Colocated hosts.
198 (colo :net colo)
199 (jump :net jump)
9b7e4069 200 (gate (jump :addr gate.jump :sshfp "precision"))
07fe1e43 201 (fender :abbrev f (colo :abbrev fc) (jump :abbrev fj))
c3997955
MW
202 (fender (colo :addr fender.colo :sshfp "fender")
203 (jump :addr fender.jump :sshfp "fender"))
07fe1e43 204 (precision :abbrev p (colo :abbrev pc) (jump :abbrev pj))
c3997955
MW
205 (precision (colo :addr precision.colo :sshfp "precision")
206 (jump :addr precision.jump :sshfp "precision"))
07fe1e43
MW
207 (telecaster :alias tele :abbrev t
208 (colo :alias tele.colo :abbrev tc)
209 (jump :alias tele.jump :abbrev tj))
c3997955
MW
210 (telecaster (colo :addr telecaster.colo :sshfp "telecaster")
211 (jump :addr telecaster.jump :sshfp "telecaster"))
07fe1e43
MW
212 (stratocaster :alias strat :abbrev s
213 (colo :alias strat.colo :abbrev sc)
214 (jump :alias strat.jump :abbrev sj))
c3997955
MW
215 (stratocaster (colo :addr stratocaster.colo :sshfp "stratocaster")
216 (jump :addr stratocaster.jump :sshfp "stratocaster"))
07fe1e43 217 (jazz :abbrev z (colo :abbrev zc) (jump :abbrev zj))
c3997955
MW
218 (jazz (colo :addr jazz.colo :sshfp "jazz")
219 (jump :addr jazz.jump :sshfp "jazz")
220 (iodine :addr jazz.iodine :sshfp "jazz"))
38c2de7c 221
4a372d1b 222 ;; Media server (on loan to Good Technology HSTG).
07fe1e43 223 (jaguar :abbrev jag)
376a10ac 224 (jaguar (jump :addr jaguar.jump :sshfp "jaguar"))
4a372d1b 225
a20ec58c 226 ;; Nicko's server.
c1f47051 227 (richmond (jump :svc richmond.jump))
a20ec58c 228
6ef39f28 229 ;; Wired ethernet.
04d65182
MW
230 (unsafe :net unsafe)
231 (safe :net safe)
232 (untrusted :net untrusted)
07fe1e43
MW
233 (vampire :abbrev v
234 (unsafe :abbrev vu) (dmz :abbrev vd)
235 (safe :abbrev vs) (untrusted :abbrev vx))
c3997955
MW
236 (vampire (unsafe :addr vampire.unsafe :sshfp "vampire")
237 (dmz :addr vampire.dmz :sshfp "vampire")
238 (safe :addr vampire.safe :sshfp "vampire")
239 (untrusted :addr vampire.untrusted :sshfp "vampire"))
07fe1e43 240 (ibanez :abbrev i (unsafe :abbrev iu) (dmz :abbrev id))
c3997955
MW
241 (ibanez (unsafe :addr ibanez.unsafe :sshfp "ibanez")
242 (dmz :addr ibanez.dmz :sshfp "ibanez"))
07fe1e43
MW
243 (radius :abbrev r
244 (unsafe :abbrev ru) (dmz :abbrev rd)
245 (safe :abbrev rs) (untrusted :abbrev rx))
c3997955
MW
246 (radius (unsafe :addr radius.unsafe :sshfp "radius")
247 (dmz :addr radius.dmz :sshfp "radius")
248 (safe :addr radius.safe :sshfp "radius")
249 (untrusted :addr radius.untrusted :sshfp "radius"))
07fe1e43 250 (roadstar :abbrev rg (unsafe :abbrev rgu) (dmz :abbrev rgd))
c3997955
MW
251 (roadstar (unsafe :addr roadstar.unsafe :sshfp "roadstar")
252 (dmz :addr roadstar.dmz :sshfp "roadstar"))
07fe1e43 253 (jem :abbrev j (unsafe :abbrev ju) (dmz :abbrev jd))
c3997955
MW
254 (jem (unsafe :addr jem.unsafe :sshfp "jem")
255 (dmz :addr jem.dmz :sshfp "jem"))
07fe1e43
MW
256 (artist :abbrev a
257 (unsafe :abbrev au) (dmz :abbrev ad) (untrusted :abbrev ax))
c3997955
MW
258 (artist (unsafe :addr artist.unsafe :sshfp "artist")
259 (dmz :addr artist.dmz :sshfp "artist")
260 (untrusted :addr artist.untrusted :sshfp "artist"))
ec4898f9 261
ff6c53ad 262 ;; DHCP hosts.
07fe1e43 263 (gibson :cname gibson.dhcp :abbrev g)
4b5e05ad
MW
264 (lespaul :cname lespaul.dhcp)
265 (firebird :cname firebird.dhcp)
aa4d55b1
MW
266 (marauder :cname marauder.dhcp)
267 (invader :cname invader.dhcp)
098020ad 268 (gretsch :cname gretsch.dhcp)
ec4898f9 269
6ef39f28 270 ;; Virtual network.
374be896 271 (vpn :net vpn)
07fe1e43 272 (crybaby :abbrev cb)
c3997955
MW
273 (crybaby (vpn :addr crybaby.vpn :sshfp "crybaby"))
274 (terror (vpn :addr terror.vpn :sshfp "terror"))
07fe1e43 275 (orange :abbrev o)
c3997955 276 (orange (vpn :addr orange.vpn :sshfp "orange"))
07fe1e43 277 (haze :abbrev h)
76bca42f 278 (haze (vpn :addr haze.vpn :sshfp "haze"))
07fe1e43 279 (groove :abbrev gr)
3584cfba 280 (groove (vpn :addr groove.vpn :sshfp "groove"))
fc0ce2ed 281 (iodine :net iodine)
ec4898f9 282
6ef39f28 283 ;; ITS.
b1d5c6c2 284 (its :net its)
c3997955
MW
285 (gw (its :addr gw.its))
286 (mz (its :addr mz.its))
ec4898f9 287
c2118713 288 ;; Strange things.
c3997955 289 (blackhole (jump :addr blackhole.jump))
c2118713 290
6ef39f28 291 ;; Delegations.
f0209b9c
MW
292 (dhcp :ns ((radius.ns.dhcp :ip radius)
293 (precision.ns.dhcp :ip precision)
1b9508ad 294 (telecaster.ns.dhcp :ip telecaster)
f0209b9c 295 (vampire.ns.dhcp :ip vampire)))
49c5f8ff
MW
296 (dyn :ns ((radius.ns.dyn :ip radius)
297 (precision.ns.dyn :ip precision)
1b9508ad 298 (telecaster.ns.dyn :ip telecaster)
49c5f8ff 299 (vampire.ns.dyn :ip vampire)))
0262908f 300 (dnserr :ns ((radius.ns.dnserr :ip radius.dmz)
f0209b9c 301 (precision.ns.dnserr :ip precision.jump)
1b9508ad 302 (telecaster.ns.dnserr :ip telecaster)
0262908f 303 (vampire.ns.dnserr :ip vampire.dmz)))
17c95de9 304 (io :ns ((ns.io :ip jazz.jump))))
b1d5c6c2
MW
305
306;;;--------------------------------------------------------------------------
307;;; Other subsidiary zones.
e80b4c2d 308
55f161b6
MW
309(defzone dhcp.distorted.org.uk
310 (gibson :addr gibson.unsafe)
311 (lespaul :addr lespaul.safe)
312 (invader :addr invader.safe)
313 (marauder :addr marauder.safe))
314
c1f47051
MW
315(defzone nicko.org
316 (richmond :addr richmond.jump))
317
e80b4c2d 318(defrevzone trusted
8aa87005
MW
319 :ns (radius.distorted.org.uk.
320 precision.distorted.org.uk.
1b9508ad 321 telecaster.distorted.org.uk.
8aa87005 322 vampire.distorted.org.uk.)
b59ce50d
MW
323 :reverse unsafe
324 :reverse vpn
325 :reverse colo
326 :reverse its
345c0f69 327 :reverse any
8aa87005
MW
328 (dhcp :ns (radius.distorted.org.uk.
329 precision.distorted.org.uk.
1b9508ad 330 telecaster.distorted.org.uk.
8aa87005 331 vampire.distorted.org.uk.))
3503589d 332 :multi (((dhcp safe) :family :ipv4 :suffix "199.29.172.dhcp") :cname *))
b3f75214 333
b29264c5 334(defrevzone (dmz :family :ipv6)
8aa87005
MW
335 :ns (radius.distorted.org.uk.
336 precision.distorted.org.uk.
1b9508ad 337 telecaster.distorted.org.uk.
8aa87005 338 vampire.distorted.org.uk.)
ff6c53ad 339 :reverse dmz)
92e99247 340
b29264c5
MW
341(defrevzone (dmz :family :ipv4)
342 (144-159 :ns (radius.distorted.org.uk.
343 precision.distorted.org.uk.
344 telecaster.distorted.org.uk.
345 vampire.distorted.org.uk.))
346 :multi ((dmz :suffix "144-159") :cname *))
347
348(defzone 144-159.204.49.62.in-addr.arpa
349 :ns (radius.distorted.org.uk.
350 precision.distorted.org.uk.
351 telecaster.distorted.org.uk.
352 vampire.distorted.org.uk.)
353 :reverse ((((:ipv4 dmz)))))
354
355(defrevzone (jump :family :ipv6)
8aa87005
MW
356 :ns (radius.distorted.org.uk.
357 precision.distorted.org.uk.
1b9508ad 358 telecaster.distorted.org.uk.
8aa87005 359 vampire.distorted.org.uk.)
38c2de7c
MW
360 :reverse jump)
361
b29264c5
MW
362(defrevzone (jump :family :ipv4)
363 (64-79 :ns (radius.distorted.org.uk.
364 precision.distorted.org.uk.
365 telecaster.distorted.org.uk.
366 vampire.distorted.org.uk.))
367 :multi ((jump :suffix "64-79") :cname *))
368
369(defzone 64-79.198.13.212.in-addr.arpa
370 :ns (radius.distorted.org.uk.
371 precision.distorted.org.uk.
372 telecaster.distorted.org.uk.
373 vampire.distorted.org.uk.)
374 :reverse ((((:ipv4 jump)))))
375
652c34be
MW
376(defrevzone distorted.org.uk-he
377 :ns (radius.distorted.org.uk.
378 precision.distorted.org.uk.
1b9508ad 379 telecaster.distorted.org.uk.
652c34be
MW
380 vampire.distorted.org.uk.)
381 :reverse distorted.org.uk-he)
382
383(defrevzone distorted.org.uk-jump
384 :ns (radius.distorted.org.uk.
385 precision.distorted.org.uk.
1b9508ad 386 telecaster.distorted.org.uk.
652c34be
MW
387 vampire.distorted.org.uk.)
388 :reverse distorted.org.uk-jump)
389
995d75b4 390(defzone io.distorted.org.uk
17c95de9 391 :ns ((ns :ip jazz.jump))
995d75b4
MW
392 (about :txt "Fake zone used for IP-over-DNS tunnelling."))
393
b1d5c6c2 394;;;----- That's all, folks --------------------------------------------------