From d33e251dd7a602a85c05d4890e20bdb02e5e7b72 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sun, 19 Feb 2012 16:43:42 -0500 Subject: [PATCH] Note on topological-sort of CNAMEs --- zonedb.rkt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/zonedb.rkt b/zonedb.rkt index 0644a7b..58f5be4 100644 --- a/zonedb.rkt +++ b/zonedb.rkt @@ -179,7 +179,15 @@ ;; rr-set->list : SetOf -> ListOf ;; Like set->list, but places all CNAME records first. ;; This is apparently to work around bugs in old versions of BIND? +;; ;; TODO: Perhaps the CNAMEs even need to be in topologically-sorted order? +;; http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/dns-response-taxonomy.html +;; has this to say on this topic: +;; "A content DNS server following the algorithm in ยง 4.3.2 of RFC +;; 1034 will insert this chain in first-to-last order in the +;; response. The response parsing code in most resolving proxy DNS +;; servers and DNS client libraries expects this order. However, +;; the actual text of RFC 1034 itself does not guarantee it." (define (rr-set->list rrs) (append (set->list (filter-by-type rrs 'cname)) (set->list (set-filter (lambda (rr) (not (eqv? (rr-type rr) 'cname))) rrs))))