;; 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)
- (dolist (addr (host-addrs (host-parse (cdr any-provider))))
+ (do-host (addr (cdr any-provider))
(let ((family (ipaddr-family addr)))
(if (member family *anycast-routable-families*)
(zone-set-address #'rec addr
(dolist (provider (list* any-provider default-provider other-providers))
(zone-set-address #'rec (cdr provider)
:make-ptr-p (eq provider any-provider)
- :name (concatenate 'string prefix "."
- (string-downcase (car provider))
- "." (string-downcase zname))))))
+ :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.
(defzone distorted.org.uk
;; Nameservers.
- :ns #+view/inside ((radius.ns :ip radius)
- (precision.ns :ip precision)
- (vampire.ns :ip vampire))
- #-view/inside ((radius.ns :ip radius)
- (precision.ns :ip precision)
- (mythic-beasts-1.ns :ip mythic-ns1)
- (mythic-beasts-2.ns :ip mythic-ns2)
- (chiark.ns :ip chiark.greenend.org.uk))
+ :ns ((radius.ns :ip radius)
+ (precision.ns :ip precision)
+ (telecaster.ns :ip telecaster)
+ (national.ns :ip national)
+ #+view/inside (vampire.ns :ip vampire)
+ #-view/inside (mythic-beasts-1.ns :ip mythic-ns1)
+ #-view/inside (mythic-beasts-2.ns :ip mythic-ns2)
+ #-view/inside (mythic-beasts-3.ns :ip mythic-ns3)
+ #-view/inside (chiark.ns :ip chiark.greenend.org.uk))
+
+ ;; Certification.
+ :caa ((:issue "letsencrypt.org")
+ (:issue "distorted.org.uk"))
;; Mail servers.
- ((@ mail)
- :mx mail
- :srv ((:smtp mail)))
- ((lists bugs cryptomail)
- :ttl 300
- :mx mail
- :srv ((:smtp old-mail)))
+ ((@ mail blackhole) :mx mail :srv ((:smtp mail)))
+ ((bugs) :ttl 300 :mx lists :srv ((:smtp bugs)))
+ ((lists) :ttl 300 :mx lists :srv ((:smtp lists)))
(stratocaster.20140403._domainkey
:dkim ("stratocaster-20140403"
:srv ((:http www)
(:ftp ftp))
- ;; 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)
-
;; Colocated services.
- ((irc vox) (colo :svc jazz.colo :sshfp "jazz")
- (jump :svc jazz.jump :sshfp "jazz"))
+ ((irc vox keys wiki) (colo :svc jazz.colo :sshfp "jazz")
+ (jump :svc jazz.jump :sshfp "jazz"))
+ ((irc vox keys wiki) :tlsa (:https (:service-certificate-constraint
+ :public-key :sha-256 #p"https-jazz")))
+ ((bugs lists db ftp) (colo :svc telecaster.colo :sshfp "telecaster")
+ (jump :svc telecaster.jump :sshfp "telecaster"))
+ ((bugs lists ftp) :tlsa (:https #3=(:service-certificate-constraint
+ :public-key :sha-256
+ #p"https-telecaster")))
+ (dyndns :svc telecaster.jump :sshfp "telecaster")
((git www mail) (colo :svc stratocaster.colo :sshfp "stratocaster")
(jump :svc stratocaster.jump :sshfp "stratocaster"))
+ ((www git mail @) :tlsa (:https #2=(:service-certificate-constraint
+ :public-key :sha-256
+ #p"https-stratocaster")))
+ (www-cache :tlsa (3127 #1=(:trust-anchor-assertion
+ :certificate :sha-256 #p"distorted-ca")))
+ (mail :tlsa ((:submission :imap :imaps) #1#))
+ (mail :tlsa (:smtp
+ #+view/inside #1#
+ #-view/inside (:domain-issued-certificate
+ :public-key :sha-256
+ #p"smtps-stratocaster")))
+ ((bugs lists) :tlsa (:smtp
+ #+view/inside #1#
+ #-view/inside (:domain-issued-certificate
+ :public-key :sha-256
+ #p"smtps-telecaster")))
:svc #+view/inside stratocaster.colo
#-view/inside stratocaster.jump
(cabal :svc stratocaster.colo :sshfp "stratocaster")
- ((db ftp) (colo :svc telecaster.colo :sshfp "telecaster")
- (jump :svc telecaster.jump :sshfp "telecaster"))
;; Local services.
- ((rawk pifi) (unsafe :svc artist.unsafe)
- (dmz :svc artist.dmz))
+ (rawk (unsafe :svc artist.unsafe) (dmz :svc artist.dmz))
+ (rawk :tlsa (:https (:service-certificate-constraint
+ :public-key :sha-256
+ #p"https-artist")))
(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 :sshfp "vampire")
(dmz :addr anon.dmz))
;; Fancy connectivity.
- (iodine (jump :addr jazz.jump))
+ (iodine (jump :svc jazz.jump))
+ (hippotat (jump :svc jazz.jump))
;; Colocated hosts.
(colo :net colo)
(jump :net jump)
(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) (vpn :abbrev pv))
(precision (colo :addr precision.colo :sshfp "precision")
- (jump :addr precision.jump :sshfp "precision"))
+ (jump :addr precision.jump :sshfp "precision")
+ (vpn :addr precision.vpn :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"))
- (telecaster :alias tele)
+ (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"))
- (stratocaster :alias strat)
+ (jazz :abbrev z (colo :abbrev zc) (jump :abbrev zj) (vpn :abbrev :zv))
(jazz (colo :addr jazz.colo :sshfp "jazz")
(jump :addr jazz.jump :sshfp "jazz")
- (iodine :addr jazz.iodine :sshfp "jazz"))
+ (vpn :addr jazz.vpn :sshfp "jazz")
+ (iodine :addr jazz.iodine :sshfp "jazz")
+ (hippo :addr jazz.hippo :sshfp "jazz"))
+
+ ;; Virtual hosts.
+ (national :abbrev n (linode :abbrev nl) (upn :abbrev ny))
+ (national (linode :addr national.linode)
+ (upn :addr national.upn))
;; Media server (on loan to Good Technology HSTG).
- (jaguar (jump :addr jaguar.jump))
+ (jaguar :abbrev jag)
+ (jaguar (jump :addr jaguar.jump :sshfp "jaguar"))
;; Nicko's server.
- (richmond (jump :addr 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 access points.
+ (wireless :net wireless)
+ (evolution (safe :addr evolution.safe))
+ (evolution :alias evo)
+ (kitkat :alias ap0)
+ (kitkat (safe :addr kitkat.safe))
+ (lunch :alias ap1)
+ (lunch (safe :addr lunch.safe))
+
+ ;; Switches.
+ (grigsby :alias tp0)
+ (grigsby (safe :addr grigsby.safe))
+ (carling :alias tp1)
+ (carling (safe :addr carling.safe))
+ (tritan :alias tp2)
+ (tritan (safe :addr tritan.safe))
;; Wired ethernet.
(unsafe :net unsafe)
(safe :net safe)
(untrusted :net untrusted)
+ (vampire :abbrev v
+ (unsafe :abbrev vu) (dmz :abbrev vd) (vpn :abbrev vv)
+ (safe :abbrev vs) (untrusted :abbrev vx))
(vampire (unsafe :addr vampire.unsafe :sshfp "vampire")
(dmz :addr vampire.dmz :sshfp "vampire")
+ (vpn :addr vampire.vpn :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) (vpn :abbrev rv)
+ (safe :abbrev rs) (untrusted :abbrev rx))
(radius (unsafe :addr radius.unsafe :sshfp "radius")
(dmz :addr radius.dmz :sshfp "radius")
+ (vpn :addr radius.vpn :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"))
+ (universe :abbrev u (unsafe :abbrev uu) (dmz :abbrev ud))
+ (universe (unsafe :addr universe.unsafe :sshfp "universe")
+ (dmz :addr universe.dmz :sshfp "universe"))
+ (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 :addr crybaby.vpn :sshfp "crybaby"))
+ (crybaby :abbrev cb)
+ (crybaby (vpn :addr crybaby.vpn :sshfp "crybaby")
+ (hippo :addr crybaby.hippo :sshfp "crybaby"))
+ (spirit (vpn :addr spirit.vpn :sshfp "spirit")
+ (hippo :addr spirit.hippo :sshfp "spirit"))
(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)
+ (hippo :net hippo)
;; ITS.
(its :net its)
;; Delegations.
(dhcp :ns ((radius.ns.dhcp :ip radius)
+ (vampire.ns.dhcp :ip vampire)
(precision.ns.dhcp :ip precision)
- (vampire.ns.dhcp :ip vampire)))
+ (telecaster.ns.dhcp :ip telecaster)
+ (national.ns.dhcp :ip national))
+ :ds ((55966 :rsasha256 :sha1
+ "95b05c1f4e84f950f29630004bac447f8a87ca33")
+ (55966 :rsasha256 :sha256
+ #.(concatenate 'string "31696bf54b577362b2eb75793adeb9ec"
+ "2e8440ec671371b35d8d978cd9ca3007"))))
(dyn :ns ((radius.ns.dyn :ip radius)
+ (vampire.ns.dyn :ip vampire)
(precision.ns.dyn :ip precision)
- (vampire.ns.dyn :ip vampire)))
+ (telecaster.ns.dyn :ip telecaster)
+ (national.ns.dyn :ip national))
+ :ds ((11335 :rsasha256 :sha1
+ "7ed2b843b0bfb38ceca68617dfacbeafab1d1ea9")
+ (11335 :rsasha256 :sha256
+ #.(concatenate 'string "6eb15eb587c48f5b84ca128a656a4cce"
+ "0a41cf040d3d0f15a44dffd6476b2b55"))))
(dnserr :ns ((radius.ns.dnserr :ip radius.dmz)
+ (vampire.ns.dnserr :ip vampire.dmz)
(precision.ns.dnserr :ip precision.jump)
- (vampire.ns.dnserr :ip vampire.dmz)))
+ (telecaster.ns.dnserr :ip telecaster.jump)
+ (national.ns.dnserr :ip national.linode))
+ :ds ((40945 :rsasha256 :sha1
+ "f35b5d0b877b940e63ad1b3afc21d6ba83cd1b3b")
+ (40945 :rsasha256 :sha256
+ #.(concatenate 'string "fb171d206d4d64c5a7a6c290ce6e20df"
+ "44f1db7f41e2260f1fe8d7c55d524c11"))))
(io :ns ((ns.io :ip jazz.jump))))
;;;--------------------------------------------------------------------------
;;; Other subsidiary zones.
+(defzone dhcp.distorted.org.uk
+ :ns ((radius.ns :ip radius.dmz)
+ (vampire.ns :ip vampire.dmz)
+ (precision.ns :ip precision.jump)
+ (telecaster.ns :ip telecaster.jump)
+ (national.ns :ip national.linode))
+ (gibson :addr gibson.unsafe)
+ (crybaby :addr crybaby.unsafe)
+ (lespaul :addr lespaul.unsafe)
+ (gretsch :addr gretsch.unsafe)
+ (spirit :addr spirit.unsafe)
+ (haze :addr haze.unsafe)
+ (invader :addr invader.safe)
+ (marauder :addr marauder.safe))
+
+(defzone dyn.distorted.org.uk
+ :ns ((radius.ns :ip radius)
+ (vampire.ns :ip vampire)
+ (precision.ns :ip precision)
+ (telecaster.ns :ip telecaster)
+ (national.ns :ip national)))
+
+(defzone nicko.org
+ (richmond :addr richmond.jump))
+
(defrevzone trusted
:ns (radius.distorted.org.uk.
+ vampire.distorted.org.uk.
precision.distorted.org.uk.
- vampire.distorted.org.uk.)
+ telecaster.distorted.org.uk.
+ national.distorted.org.uk.)
:reverse unsafe
:reverse vpn
:reverse colo
:reverse its
:reverse any
(dhcp :ns (radius.distorted.org.uk.
+ vampire.distorted.org.uk.
precision.distorted.org.uk.
- vampire.distorted.org.uk.))
+ telecaster.distorted.org.uk.
+ national.distorted.org.uk.))
:multi (((dhcp safe) :family :ipv4 :suffix "199.29.172.dhcp") :cname *))
-(defrevzone dmz
+(defzone dhcp.199.29.172.in-addr.arpa
:ns (radius.distorted.org.uk.
+ vampire.distorted.org.uk.
precision.distorted.org.uk.
- vampire.distorted.org.uk.)
- :reverse dmz)
+ telecaster.distorted.org.uk.
+ national.distorted.org.uk.))
-(defrevzone jump
+(defrevzone untrusted
:ns (radius.distorted.org.uk.
+ vampire.distorted.org.uk.
precision.distorted.org.uk.
- vampire.distorted.org.uk.)
+ telecaster.distorted.org.uk.
+ national.distorted.org.uk.))
+
+(defzone 128-143.238.187.81.in-addr.arpa
+ :ns (radius.distorted.org.uk.
+ vampire.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ national.distorted.org.uk.
+ secondary-dns.co.uk.)
+ :reverse ((((:ipv4 dmz)))))
+
+(defzone 195.113.2.81.in-addr.arpa
+ :ns (radius.distorted.org.uk.
+ vampire.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ national.distorted.org.uk.
+ secondary-dns.co.uk.)
+ :reverse ((((:ipv4 gw)))))
+
+(defrevzone (jump :family :ipv6)
+ :ns (radius.distorted.org.uk.
+ vampire.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ national.distorted.org.uk.)
:reverse jump)
+(defrevzone (jump :family :ipv4)
+ (64-79 :ns (radius.distorted.org.uk.
+ vampire.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ national.distorted.org.uk.))
+ :multi ((jump :suffix "64-79") :cname *))
+
+(defzone 64-79.198.13.212.in-addr.arpa
+ :ns (radius.distorted.org.uk.
+ vampire.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ national.distorted.org.uk.)
+ :reverse ((((:ipv4 jump)))))
+
+(defrevzone (distorted.org.uk-aaisp :family :ipv6)
+ :ns (radius.distorted.org.uk.
+ vampire.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ national.distorted.org.uk.
+ secondary-dns.co.uk.)
+ (0.7.3.6.8.6.4.6.1.0.0.0 :ns (radius.distorted.org.uk.
+ vampire.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ national.distorted.org.uk.))
+ :reverse ((((:ipv6 distorted.org.uk-aaisp)))))
+
+(defrevzone (dhcp :family :ipv6)
+ :ns (radius.distorted.org.uk.
+ vampire.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ national.distorted.org.uk.))
+
+(defrevzone distorted.org.uk-jump
+ :ns (radius.distorted.org.uk.
+ vampire.distorted.org.uk.
+ precision.distorted.org.uk.
+ telecaster.distorted.org.uk.
+ national.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."))