(load "hosts.lisp" :verbose nil)
+;;;--------------------------------------------------------------------------
+;;; Anycast services.
+
+(defvar *anycast-routable-families* (list :ipv6))
+
+(defzoneparse :anycast (name data rec :prefix prefix :zname zname)
+ (destructuring-bind (any-provider default-provider &rest other-providers)
+ data
+
+ ;; First, the default address. If the anycast network is preferred then
+ ;; this is easy; otherwise we have something complicated to do because
+ ;; IPv6 anycast addresses are globally routable, while IPv4 ones aren't.
+ (if (zone-preferred-subnet-p (car any-provider))
+ (zone-set-address #'rec (cdr any-provider) :make-ptr-p t)
+ (do-host (addr (cdr any-provider))
+ (let ((family (ipaddr-family addr)))
+ (if (member family *anycast-routable-families*)
+ (zone-set-address #'rec addr
+ :family family :make-ptr-p t)
+ (zone-set-address #'rec (cdr default-provider)
+ :family family :make-ptr-p nil)))))
+
+ ;; Now for all of the others.
+ (dolist (provider (list* any-provider default-provider other-providers))
+ (zone-set-address #'rec (cdr provider)
+ :make-ptr-p (eq provider any-provider)
+ :name (domain-name-concat prefix
+ (zone-parse-host
+ (car provider)
+ zname))))))
+
+;;;--------------------------------------------------------------------------
+;;; Hostname abbreviations.
+
+(defvar *abbrev-subdomain*
+ (make-domain-name :labels '("abbrev") :absolutep nil))
+(defparameter *abbrev-used* (make-hash-table :test #'equal))
+
+(defzoneparse :abbrev (name data rec :zname zname)
+ (let* ((domain (zone-parse-host data
+ (domain-name-concat *abbrev-subdomain*
+ zname)))
+ (key (princ-to-string domain))
+ (existing (gethash key *abbrev-used*)))
+ (when existing
+ (error "Abbrev collision for ~A between ~A and ~A."
+ domain existing name))
+ (setf (gethash key *abbrev-used*) name)
+ (rec :name domain
+ :type :cname
+ :data name)))
+
;;;--------------------------------------------------------------------------
;;; Other definitions.
;; Nameservers.
:ns #+view/inside ((radius.ns :ip radius)
(precision.ns :ip precision)
+ (telecaster.ns :ip telecaster)
(vampire.ns :ip vampire))
#-view/inside ((radius.ns :ip radius)
(precision.ns :ip precision)
+ (telecaster.ns :ip telecaster)
(mythic-beasts-1.ns :ip mythic-ns1)
(mythic-beasts-2.ns :ip mythic-ns2)
(chiark.ns :ip chiark.greenend.org.uk))
;; Mail servers.
- ((@ mail lists bugs cryptomail)
+ ((@ mail blackhole)
:mx mail
:srv ((:smtp mail)))
+ ((lists bugs cryptomail)
+ :ttl 300
+ :mx mail
+ :srv ((:smtp old-mail)))
+
+ (stratocaster.20140403._domainkey
+ :dkim ("stratocaster-20140403"
+ :v "DKIM1" :k "rsa" :h "sha256" :s "email"))
;; Anycast services.
- (dns0 (any :a dns0.any)
- (jump :svc precision.jump)
- (dmz :svc radius.dmz)
- (unsafe :svc radius.unsafe)
- (colo :svc precision.colo))
- (dns1 (any :a dns1.any)
- (jump :svc telecaster.jump)
- (dmz :svc vampire.dmz)
- (unsafe :svc vampire.unsafe)
- (colo :svc telecaster.colo))
+ (dns0 :anycast ((any dns0.any)
+ (jump precision.jump)
+ (colo precision.colo)
+ (dmz radius.dmz)
+ (unsafe radius.unsafe)))
+ (dns1 :anycast ((any dns1.any)
+ (jump telecaster.jump)
+ (dmz vampire.dmz)
+ (unsafe vampire.unsafe)
+ (colo telecaster.colo)))
(dns :cname dns0)
- (ntp0 (any :a ntp0.any)
- (jump :svc fender.jump)
- (dmz :svc ibanez.dmz)
- (unsafe :svc ibanez.unsafe)
- (colo :svc fender.colo))
- (ntp1 (any :a ntp1.any)
- (dmz :svc vampire.dmz)
- (unsafe :svc vampire.unsafe))
+ (ntp0 :anycast ((any ntp0.any)
+ (jump fender.jump)
+ (dmz ibanez.dmz)
+ (unsafe ibanez.unsafe)
+ (colo fender.colo)))
+ (ntp1 :anycast ((any ntp1.any)
+ (dmz vampire.dmz)
+ (unsafe vampire.unsafe)))
(ntp :cname ntp0)
- (www-cache (any :a www-cache.any)
- (jump :svc telecaster.jump)
- (dmz :svc roadstar.dmz)
- (unsafe :svc roadstar.unsafe)
- (colo :svc telecaster.colo))
+ (www-cache :anycast ((any www-cache.any)
+ (jump telecaster.jump)
+ (dmz roadstar.dmz)
+ (unsafe roadstar.unsafe)
+ (colo telecaster.colo)))
(wpad :cname www-cache)
(_kerberos :txt "DISTORTED.ORG.UK")
- (krb0 (any :a krb0.any)
- (jump :svc precision.jump)
- (dmz :svc radius.dmz)
- (unsafe :svc radius.unsafe)
- (colo :svc precision.colo))
- (krb1 (any :a krb1.any)
- (dmz :svc vampire.dmz)
- (unsafe :svc vampire.unsafe))
+ (krb0 :anycast ((any krb0.any)
+ (jump precision.jump)
+ (dmz radius.dmz)
+ (unsafe radius.unsafe)
+ (colo precision.colo)))
+ (krb1 :anycast ((any krb1.any)
+ (dmz vampire.dmz)
+ (unsafe vampire.unsafe)))
(krb-master (unsafe :svc radius.unsafe)
(dmz :svc radius.dmz))
:srv (((:kerberos :protocol :udp)
:srv ((:http www)
(:ftp ftp))
- ;; Entry is via little router box.
- (dmz :net dmz)
- (guvnor (inside :svc gate.dmz) (dmz :a guvnor.dmz))
- (anon (dmz :a anon.dmz))
- (gate (dmz :a gate.dmz))
- (nat (dmz :a nat.dmz))
-
- ;; Wireless gateway.
- (wireless :net wireless)
- (evolution (safe :a evolution.safe))
- (evolution :alias evo)
-
;; Colocated services.
- (irc (colo :svc jazz.colo)
- (jump :svc jazz.jump))
- ((git www) (colo :svc stratocaster.colo)
- (jump :svc stratocaster.jump))
+ ((irc vox keys) (colo :svc jazz.colo :sshfp "jazz")
+ (jump :svc jazz.jump :sshfp "jazz"))
+ ((git www mail) (colo :svc stratocaster.colo :sshfp "stratocaster")
+ (jump :svc stratocaster.jump :sshfp "stratocaster"))
+ ((www @) :tlsa (:https (:service-certificate-constraint
+ :certificate :sha-256 #p"http-server-www#1")))
+ (git :tlsa (:https (:trust-anchor-assertion
+ :certificate :sha-256 #p"distorted-ca")))
+ (www-cache :tlsa (3127 (:trust-anchor-assertion
+ :certificate :sha-256 #p"distorted-ca")))
+ (mail :tlsa ((:smtp :submission :imap)
+ (:trust-anchor-assertion
+ :certificate :sha-256 #p"distorted-ca")))
:svc #+view/inside stratocaster.colo
#-view/inside stratocaster.jump
- (cabal :svc stratocaster.colo)
+ (cabal :svc stratocaster.colo :sshfp "stratocaster")
+ ((db ftp) (colo :svc telecaster.colo :sshfp "telecaster")
+ (jump :svc telecaster.jump :sshfp "telecaster"))
+ (dyndns :svc telecaster.jump :sshfp "telecaster")
;; Local services.
- (rawk (unsafe :svc artist.unsafe)
- (dmz :svc artist.dmz))
- (pifi (vpn :svc orange.vpn)
- (dmz :svc artist.dmz))
- ((ftp rsync wiki bugs mail db i2p vox) :svc vampire)
+ ((rawk pifi) (unsafe :svc artist.unsafe)
+ (dmz :svc artist.dmz))
+ (mirror (dmz :svc roadstar.dmz :sshfp "roadstar")
+ (unsafe :svc roadstar.unsafe :sshfp "roadstar"))
+ ((wiki bugs old-mail i2p) :svc vampire :sshfp "vampire")
;; Internal services.
- #+view/inside ((news lpr) :svc vampire.unsafe)
+ #+view/inside ((news lpr) :svc vampire.unsafe :sshfp "vampire")
;; Anonymity services.
- (tor :svc #+view/inside vampire.unsafe
- #-view/inside anon.dmz)
+ (anon (colo :svc jazz.colo)
+ (unsafe :svc vampire.unsafe)
+ (jump :addr anon.jump)
+ (dmz :addr anon.dmz))
;; Fancy connectivity.
- (iodine (jump :a jazz.jump))
+ (iodine (jump :svc jazz.jump))
;; Colocated hosts.
(colo :net colo)
(jump :net jump)
- (fender (colo :a fender.colo)
- (jump :a fender.jump))
- (precision (colo :a precision.colo)
- (jump :a precision.jump))
- (telecaster (colo :a telecaster.colo)
- (jump :a telecaster.jump))
- (telecaster :alias tele)
- (stratocaster (colo :a stratocaster.colo)
- (jump :a stratocaster.jump))
- (stratocaster :alias strat)
- (jazz (colo :a jazz.colo)
- (jump :a jazz.jump)
- (iodine :a jazz.iodine))
+ (gate (jump :addr gate.jump :sshfp "precision"))
+ (fender :abbrev f (colo :abbrev fc) (jump :abbrev fj))
+ (fender (colo :addr fender.colo :sshfp "fender")
+ (jump :addr fender.jump :sshfp "fender"))
+ (precision :abbrev p (colo :abbrev pc) (jump :abbrev pj))
+ (precision (colo :addr precision.colo :sshfp "precision")
+ (jump :addr precision.jump :sshfp "precision"))
+ (telecaster :alias tele :abbrev t
+ (colo :alias tele.colo :abbrev tc)
+ (jump :alias tele.jump :abbrev tj))
+ (telecaster (colo :addr telecaster.colo :sshfp "telecaster")
+ (jump :addr telecaster.jump :sshfp "telecaster"))
+ (stratocaster :alias strat :abbrev s
+ (colo :alias strat.colo :abbrev sc)
+ (jump :alias strat.jump :abbrev sj))
+ (stratocaster (colo :addr stratocaster.colo :sshfp "stratocaster")
+ (jump :addr stratocaster.jump :sshfp "stratocaster"))
+ (jazz :abbrev z (colo :abbrev zc) (jump :abbrev zj))
+ (jazz (colo :addr jazz.colo :sshfp "jazz")
+ (jump :addr jazz.jump :sshfp "jazz")
+ (iodine :addr jazz.iodine :sshfp "jazz"))
+
+ ;; Media server (on loan to Good Technology HSTG).
+ (jaguar :abbrev jag)
+ (jaguar (jump :addr jaguar.jump :sshfp "jaguar"))
;; Nicko's server.
- (richmond (jump :a richmond.jump))
+ (richmond (jump :svc richmond.jump))
+
+ ;; Entry is via little router box.
+ (dmz :net dmz)
+ (guvnor (dmz :addr guvnor.dmz))
+ (nat (dmz :addr nat.dmz))
+
+ ;; Wireless gateway.
+ (wireless :net wireless)
+ (evolution (safe :addr evolution.safe))
+ (evolution :alias evo)
+
+ ;; Switches.
+ (tp0 (safe :addr tp0.safe))
+ (tp1 (safe :addr tp1.safe))
+ (tp2 (safe :addr tp2.safe))
;; Wired ethernet.
(unsafe :net unsafe)
(safe :net safe)
(untrusted :net untrusted)
- (vampire (unsafe :a vampire.unsafe)
- (dmz :a vampire.dmz)
- (safe :a vampire.safe)
- (untrusted :a vampire.untrusted))
- (ibanez (unsafe :a ibanez.unsafe)
- (dmz :a ibanez.dmz))
- (radius (unsafe :a radius.unsafe)
- (dmz :a radius.dmz)
- (safe :a radius.safe)
- (untrusted :a radius.untrusted))
- (roadstar (unsafe :a roadstar.unsafe)
- (dmz :a roadstar.dmz))
- (jem (unsafe :a jem.unsafe)
- (dmz :a jem.dmz))
- (artist (unsafe :a artist.unsafe)
- (dmz :a artist.dmz)
- (untrusted :a artist.untrusted))
+ (vampire :abbrev v
+ (unsafe :abbrev vu) (dmz :abbrev vd)
+ (safe :abbrev vs) (untrusted :abbrev vx))
+ (vampire (unsafe :addr vampire.unsafe :sshfp "vampire")
+ (dmz :addr vampire.dmz :sshfp "vampire")
+ (safe :addr vampire.safe :sshfp "vampire")
+ (untrusted :addr vampire.untrusted :sshfp "vampire"))
+ (ibanez :abbrev i (unsafe :abbrev iu) (dmz :abbrev id))
+ (ibanez (unsafe :addr ibanez.unsafe :sshfp "ibanez")
+ (dmz :addr ibanez.dmz :sshfp "ibanez"))
+ (radius :abbrev r
+ (unsafe :abbrev ru) (dmz :abbrev rd)
+ (safe :abbrev rs) (untrusted :abbrev rx))
+ (radius (unsafe :addr radius.unsafe :sshfp "radius")
+ (dmz :addr radius.dmz :sshfp "radius")
+ (safe :addr radius.safe :sshfp "radius")
+ (untrusted :addr radius.untrusted :sshfp "radius"))
+ (roadstar :abbrev rg (unsafe :abbrev rgu) (dmz :abbrev rgd))
+ (roadstar (unsafe :addr roadstar.unsafe :sshfp "roadstar")
+ (dmz :addr roadstar.dmz :sshfp "roadstar"))
+ (jem :abbrev j (unsafe :abbrev ju) (dmz :abbrev jd))
+ (jem (unsafe :addr jem.unsafe :sshfp "jem")
+ (dmz :addr jem.dmz :sshfp "jem"))
+ (artist :abbrev a
+ (unsafe :abbrev au) (dmz :abbrev ad) (untrusted :abbrev ax))
+ (artist (unsafe :addr artist.unsafe :sshfp "artist")
+ (dmz :addr artist.dmz :sshfp "artist")
+ (untrusted :addr artist.untrusted :sshfp "artist"))
+ (groove :abbrev gr)
+ (groove (unsafe :addr groove.unsafe :sshfp "groove"))
;; DHCP hosts.
- (gibson :cname gibson.dhcp)
+ (gibson :cname gibson.dhcp :abbrev g)
(lespaul :cname lespaul.dhcp)
(firebird :cname firebird.dhcp)
(marauder :cname marauder.dhcp)
(invader :cname invader.dhcp)
+ (gretsch :cname gretsch.dhcp)
;; Virtual network.
(vpn :net vpn)
- (crybaby (vpn :a crybaby.vpn))
- (terror (vpn :a terror.vpn))
- (orange (vpn :a orange.vpn))
- (mango (vpn :a mango.vpn))
+ (crybaby :abbrev cb)
+ (crybaby (vpn :addr crybaby.vpn :sshfp "crybaby"))
+ (terror (vpn :addr terror.vpn :sshfp "terror"))
+ (orange :abbrev o)
+ (orange (vpn :addr orange.vpn :sshfp "orange"))
+ (haze :abbrev h)
+ (haze (vpn :addr haze.vpn :sshfp "haze"))
(iodine :net iodine)
;; ITS.
(its :net its)
- (gw (its :a gw.its))
- (mz (its :a mz.its))
+ (gw (its :addr gw.its))
+ (mz (its :addr mz.its))
;; Strange things.
- (blackhole (jump :a blackhole.jump))
+ (blackhole (jump :addr blackhole.jump))
;; Delegations.
(dhcp :ns ((radius.ns.dhcp :ip radius)
(precision.ns.dhcp :ip precision)
+ (telecaster.ns.dhcp :ip telecaster)
(vampire.ns.dhcp :ip vampire)))
(dyn :ns ((radius.ns.dyn :ip radius)
(precision.ns.dyn :ip precision)
+ (telecaster.ns.dyn :ip telecaster)
(vampire.ns.dyn :ip vampire)))
(dnserr :ns ((radius.ns.dnserr :ip radius.dmz)
(precision.ns.dnserr :ip precision.jump)
+ (telecaster.ns.dnserr :ip telecaster)
(vampire.ns.dnserr :ip vampire.dmz)))
(io :ns ((ns.io :ip jazz.jump))))
;;;--------------------------------------------------------------------------
;;; Other subsidiary zones.
+(defzone dhcp.distorted.org.uk
+ (gibson :addr gibson.unsafe)
+ (lespaul :addr lespaul.safe)
+ (invader :addr invader.safe)
+ (marauder :addr marauder.safe))
+
+(defzone nicko.org
+ (richmond :addr richmond.jump))
+
(defrevzone trusted
- :ns ((radius.ns :ip radius)
- (precision.ns :ip precision)
- (vampire.ns :ip vampire))
+ :ns (radius.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ vampire.distorted.org.uk.)
:reverse unsafe
:reverse vpn
:reverse colo
:reverse its
:reverse any
- (dhcp :ns ((radius.ns.dhcp :ip radius)
- (precision.ns.dhcp :ip precision)
- (vampire.ns.dhcp :ip vampire)))
- :cidr-delegation
- (trusted ((dhcp safe) 199.29.172.dhcp.199.29.172.in-addr.arpa)))
-
-(defrevzone dmz
- :ns ((radius.ns :ip radius)
- (precision.ns :ip precision)
- (vampire.ns :ip vampire))
+ (dhcp :ns (radius.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ vampire.distorted.org.uk.))
+ :multi (((dhcp safe) :family :ipv4 :suffix "199.29.172.dhcp") :cname *))
+
+(defrevzone (dmz :family :ipv6)
+ :ns (radius.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ vampire.distorted.org.uk.)
:reverse dmz)
-(defrevzone jump
- :ns ((radius.ns :ip radius)
- (precision.ns :ip precision)
- (vampire.ns :ip vampire))
+(defrevzone (dmz :family :ipv4)
+ (144-159 :ns (radius.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ vampire.distorted.org.uk.))
+ :multi ((dmz :suffix "144-159") :cname *))
+
+(defzone 144-159.204.49.62.in-addr.arpa
+ :ns (radius.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ vampire.distorted.org.uk.)
+ :reverse ((((:ipv4 dmz)))))
+
+(defrevzone (jump :family :ipv6)
+ :ns (radius.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ vampire.distorted.org.uk.)
:reverse jump)
+(defrevzone (jump :family :ipv4)
+ (64-79 :ns (radius.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ vampire.distorted.org.uk.))
+ :multi ((jump :suffix "64-79") :cname *))
+
+(defzone 64-79.198.13.212.in-addr.arpa
+ :ns (radius.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ vampire.distorted.org.uk.)
+ :reverse ((((:ipv4 jump)))))
+
+(defrevzone distorted.org.uk-he
+ :ns (radius.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ vampire.distorted.org.uk.)
+ :reverse distorted.org.uk-he)
+
+(defrevzone distorted.org.uk-jump
+ :ns (radius.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ vampire.distorted.org.uk.)
+ :reverse distorted.org.uk-jump)
+
(defzone io.distorted.org.uk
:ns ((ns :ip jazz.jump))
(about :txt "Fake zone used for IP-over-DNS tunnelling."))