erldns_edns_ede (erldns v13.0.0)

View Source

Add Extended DNS Error (EDE) options to DNS responses.

This pipeline handler implements RFC 8914 Extended DNS Errors, which provides additional error information in DNS responses through EDNS0 options. This helps clients better understand why a query failed or why a particular response was returned.

Configuration

The handler can be configured through application configuration:

{erldns, [
    {packet_pipeline, [
        ...,
        erldns_edns_ede,
        ...
    ]},
    {edns_ede, #{
        enabled => true, %% Enable/disable EDE support (default: true)
        add_text => true %% Include EXTRA-TEXT in EDE (default: false)
    }
]}

Behavior

This handler examines the DNS response and adds appropriate EDE options based on:

  • Response code (SERVFAIL, REFUSED, FORMERR, etc.)
  • DNSSEC validation failures
  • Resolver errors stored in options

EDE codes are only added for error responses (SERVFAIL, REFUSED, FORMERR). Valid negative responses like NXDOMAIN do not include EDE codes.

EDE options go in the response's OPT RR, through erldns_edns:add_option/2, so a query without an OPT RR gets none (RFC 6891 §7). The pipe requires erldns_edns.

References

Summary

Functions

call/2

erldns_pipeline:call/2 callback.

deps()

-spec deps() -> erldns_pipeline:deps().

erldns_pipeline:deps/0 callback.

prepare(Opts)

erldns_pipeline:prepare/1 callback.