Skip to content


Subversion checkout URL

You can clone with
Download ZIP
DNS server, in erlang.
Erlang Other
Latest commit d82b032 @aeden aeden Revert "Revert "Use the erldns_storage:select function allowing match…
… spec.""

This reverts commit 862a7a9.


Erlang DNS Server

Serve DNS authoritative responses...with Erlang.

Build Status


To build clean:


If you've already built once and just want to recompile the erl-dns source:

./rebar compile


Zones are loaded in from JSON, either locally or through a zone server (more info coming on this).

Example JSON files are in the priv/ directory.


An example configuration file can be found in erldns.config.example.

Copy it to erldns.config and modify as needed.


Launch directly:

erl -config erldns.config -pa ebin -pa deps/**/ebin -s erldns

Or use Foreman:

foreman start


Here are some queries to try:

dig -p8053 @ a
dig -p8053 @ cname
dig -p8053 @ ns
dig -p8053 @ mx
dig -p8053 @ spf
dig -p8053 @ txt
dig -p8053 @ sshfp
dig -p8053 @ soa
dig -p8053 @ naptr

dig -p8053 @ -x ptr


In our environment (DNSimple) we are seeing 30 to 65 µs handoff times to retreive a packet from the UDP port and give it to a worker for processing. Your performance may very, but given those measurements erl-dns is capable of handling between 15k and 30k questions per second. Please note: You may need to configure the number of workers available to handle traffic at higher volumes.


The erldns_resolver module will attempt to find zone data in the zone cache. If you're embedding erl-dns in your application the easiest thing to do is to load the zone cache once the zone cache gen_server starts push an updated zone into the cache each time data changes.

To insert a zone, use erldns_zone_cache:put_zone({Name, Records}) where Name is a binary term such as <<"">> and Records is a list of dns_rr records (whose definitions can be found in deps/dns/include/dns_records.hrl). The name of each record must be the fully qualified domain name (including the zone part).

Here's an example:

  <<"">>, [
      name = <<"">>,
      type = ?DNS_TYPE_A,
      ttl = 3600,
      data = #dns_rrdata_a{ip = {1,2,3,4}}
      name = <<"">>,
      type = ?DNS_TYPE_CNAME,
      ttl = 3600,
      data = #dns_rrdata_cname{dname = <<"">>}


Folsom is used to gather runtime metrics and statistics.

There is an HTTP API for querying metric data available at


There is a administrative API for querying the current zone cache and for basic control. You can find it in

Something went wrong with that request. Please try again.