Skip to content

SERVFAIL if serving a CNAME given in “unknown RR” format

Consider the following resource zone file:

; A CNAME in URR syntax pointing to some-host.test.
urr.good-cname.test.                 TYPE5 \# 16 09 736F6D652D686F7374 04 74657374 00

When asked for urr.good-cname.test., IBDNS will reply with SERVFAIL but with an answer section containing the CNAME resource record. The logs show the following error:

14:16:48.724 [error] While applying IBDNS.Processing.CNAMEChase, an error occurred:
** (ArgumentError) errors were found at the given arguments:

  * 1st argument: not an atom

    :erlang.apply(<<9, 115, 111, 109, 101, 45, 104, 111, 115, 116, 4, 116, 101, 115, 116, 0>>, :dname, [])
    (ibdns 0.3.0) lib/ibdns/processing/cname_chase.ex:29: anonymous fn/2 in IBDNS.Processing.CNAMEChase.chase_cnames/2
    (elixir 1.13.4) lib/stream.ex:572: anonymous fn/4 in Stream.map/2
    (elixir 1.13.4) lib/enum.ex:4475: Enumerable.List.reduce/3
    (elixir 1.13.4) lib/stream.ex:1719: Enumerable.Stream.do_each/4
    (elixir 1.13.4) lib/enum.ex:4144: Enum.map/2
    (ibdns 0.3.0) lib/ibdns/processing/cname_chase.ex:30: IBDNS.Processing.CNAMEChase.chase_cnames/2
    (ibdns 0.3.0) lib/ibdns/processing/cname_chase.ex:19: IBDNS.Processing.CNAMEChase.process_query/4

The CNAME-chasing code should not attempt to operate on CNAME resource records that are given in this syntax, because nothing can guarantee that the binary RDATA can be decoded to a valid domain name.