.\" Generated by Mmark Markdown Processor - mmark.miek.nl .TH "DBHOST" 7 "August 2026" "atomdns handlers" "atomdns authors" .SH "NAME" .PP \fIdbhosts\fP \- serve data from /etc/hosts .SH "DESCRIPTION" .PP The \fIdbhost\fP handler is useful for serving data from a \fB\fC/etc/hosts\fR file. It watches the file and reloads it when written to. The \fIdbhost\fP handler can only reply to A, AAAA and PTR queries, all others are deferred to the next handler(s). .PP The \fIdbhost\fP handler can be used with readily available hosts files that block access to advertising servers. .SH "HOSTS FILE" .PP Commonly the entries are of the form \fB\fCIP_address canonical_hostname [aliases...]\fR as explained by the hosts(5) man page. .PP Examples: .PP .RS .nf # The following lines are desirable for IPv4 capable hosts 127.0.0.1 localhost 192.168.1.10 example.com example # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6\-localhost ip6\-loopback fdfc:a744:27b5:3b0e::1 example.com example .fi .RE .SH "REVERSE LOOKUPS" .PP PTR records for reverse lookups are generated automatically. .SH "SYNTAX" .PP .RS .nf dbhost [FILE] { ttl TTL } .fi .RE .IP \(bu 4 \fBFILE\fP the hosts file to read and parse. If the path is relative the path from the \fIroot\fP handler will be prepended to it. Defaults to\fB\fC/etc/hosts\fR if omitted. .IP \(bu 4 \fB\fCttl\fR change the \fBTTL\fP of the records generated (forward and reverse). The default is 3600 seconds (1 hour). .SH "EXAMPLES" .PP Load \fB\fC/etc/hosts\fR file. .PP .RS .nf \&. { dbhost } .fi .RE .PP Load \fB\fCexample.hosts\fR file in the current directory (if \fIroot\fP is not set), and only use it for \fB\fCexample.org\fR names: .PP .RS .nf example.org { dbhost example.hosts } .fi .RE .SH "SEE ALSO" .PP The form of the entries in the \fB\fC/etc/hosts\fR file are based on IETF RFC 952 \[la]https://tools.ietf.org/html/rfc952\[ra] which was updated by IETF RFC 1123 \[la]https://tools.ietf.org/html/rfc1123\[ra].