Perhaps, but I think Unbound is still messing up and comparing the A response to the CAA response.
I added some printf debugging to Unbound inside the capsforid fallback routines. Compare a functional capsforid fallback:
Good: CAA compared against CAA
[1533016604] libunbound[24381:0] info: response response->rep: ;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 0
;; flags: qr aa rd ; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
shifudao.com. IN CAA
;; ANSWER SECTION:
shifudao.com. 600 IN CAA 0 issue "digicert.com"
shifudao.com. 600 IN CAA 0 issue "1738.unknown-ca.caarecord.org"
shifudao.com. 600 IN CAA 0 issue "letsencrypt.org"
;; AUTHORITY SECTION:
;; ADDITIONAL SECTION:
;; MSG SIZE rcvd: 143
[1533016604] libunbound[24381:0] info: response caps_reply: ;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 0
;; flags: qr aa rd ; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
shifudao.com. IN CAA
;; ANSWER SECTION:
shifudao.com. 600 IN CAA 0 issue "digicert.com"
shifudao.com. 600 IN CAA 0 issue "1738.unknown-ca.caarecord.org"
shifudao.com. 600 IN CAA 0 issue "letsencrypt.org"
;; AUTHORITY SECTION:
;; ADDITIONAL SECTION:
;; MSG SIZE rcvd: 143
Bad: CAA compared against A ...
[1533016611] libunbound[24397:0] info: response response->rep: ;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 0
;; flags: qr aa rd ; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
git.shifudao.com. IN CAA
;; ANSWER SECTION:
;; AUTHORITY SECTION:
shifudao.com. 600 IN SOA ns3.dns.com. admin.dns.com. 1533005298 28800 3600 1209600 900
;; ADDITIONAL SECTION:
;; MSG SIZE rcvd: 84
[1533016611] libunbound[24397:0] info: response caps_reply: ;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 0
;; flags: qr aa rd ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
git.shifudao.com. IN CAA
;; ANSWER SECTION:
git.shifudao.com. 600 IN A 42.121.131.6
;; AUTHORITY SECTION:
;; ADDITIONAL SECTION:
;; MSG SIZE rcvd: 50
[1533016611] libunbound[24397:0] info: flags 34048 vs 34048
[1533016611] libunbound[24397:0] info: qdcount 1 vs 1
[1533016611] libunbound[24397:0] info: security 0 vs 0
[1533016611] libunbound[24397:0] info: an_numrrsets 0 vs 1
[1533016611] libunbound[24397:0] info: ns_numrrsets 1 vs 0
[1533016611] libunbound[24397:0] info: rrset_count 1 vs 1
[1533016611] libunbound[24397:0] info: Capsforid fallback: getting different replies, failed
Host git.shifudao.com not found: 2(SERVFAIL). (error)
The logging that is printed in the bad version (CAA question, A answer) I think is just a result of broken internal state in Unbound, if you run tcpdump, no such response is ever sent:
12 1.392242 121.12.104.110 172.104.24.29 DNS 136 Standard query response 0xb356 CAA git.shifudao.com SOA ns3.dns.com
I think this is an Unbound bug but I'm not sure what triggers it.