Chapter 2
Handlers
atomdns links handlers together, each handler performs a single task. Together these make up the functionality of the DNS server. This kind of architecture is called server middleware. atomdns’ configuration mostly exists out of picking what handlers you want to run. The order of the handlers in the configuration file determines that order in which they are called in the server.
Each handler has its own documentation in the README.md.
There are several types of handlers:
- handlers that return a response, i.e. dbhost in one.
- handlers that observe, and hand the DNS message over to the next handler, metrics for instance.
- handlers that change the in-transit message and call the next handler. Currently these are not implemented.
- hanlders that add data to the context, geoip adds geographical data to it. This allows handlers up-to-chain to make use of that data, acl uses this data.
-
acl - enforces access control policies
-
any - give a minimal response to ANY queries
-
as112 - an AS112 black hole server
-
chaos - respond to TXT queries in the CH class
-
cookie - adds an DNS cookie of this server to each reply
-
dbfile - serve zone data from an RFC 1035-style file
-
dbhosts - serve data from /etc/hosts
-
dbsqilte - serve zone data from a SQLite database
-
drunk - test client behavior
-
geoip - add geographical location data
-
log - log queries
-
metrics - enable prometheus metrics
-
msgcache - cache DNS messages
-
nsid - adds an identifier of this server to each reply
-
refuse - refuse queries
-
sign - add DNSSEC records to zone files
-
template - use Go templates to reply
-
unpack - unpack the initial query
-
url - serve zone data from an URL
-
whoami - return your resolver’s local IP address, port and transport
-
yes - always respond to positively to queries