| 1 |
.\" Generated by Mmark Markdown Processor - mmark.miek.nl |
| 2 |
.TH "DBHOST" 7 "August 2026" "atomdns handlers" "atomdns authors" |
| 3 |
|
| 4 |
.SH "NAME" |
| 5 |
.PP |
| 6 |
\fIdbhosts\fP \- serve data from /etc/hosts |
| 7 |
|
| 8 |
.SH "DESCRIPTION" |
| 9 |
.PP |
| 10 |
The \fIdbhost\fP handler is useful for serving data from a \fB\fC/etc/hosts\fR file. It watches the file and reloads it |
| 11 |
when written to. The \fIdbhost\fP handler can only reply to A, AAAA and PTR queries, all others are deferred to |
| 12 |
the next handler(s). |
| 13 |
|
| 14 |
.PP |
| 15 |
The \fIdbhost\fP handler can be used with readily available hosts files that block access to advertising servers. |
| 16 |
|
| 17 |
.SH "HOSTS FILE" |
| 18 |
.PP |
| 19 |
Commonly the entries are of the form \fB\fCIP_address canonical_hostname [aliases...]\fR as explained by |
| 20 |
the hosts(5) man page. |
| 21 |
|
| 22 |
.PP |
| 23 |
Examples: |
| 24 |
|
| 25 |
.PP |
| 26 |
.RS |
| 27 |
|
| 28 |
.nf |
| 29 |
# The following lines are desirable for IPv4 capable hosts |
| 30 |
127.0.0.1 localhost |
| 31 |
192.168.1.10 example.com example |
| 32 |
|
| 33 |
# The following lines are desirable for IPv6 capable hosts |
| 34 |
::1 localhost ip6\-localhost ip6\-loopback |
| 35 |
fdfc:a744:27b5:3b0e::1 example.com example |
| 36 |
|
| 37 |
.fi |
| 38 |
.RE |
| 39 |
|
| 40 |
.SH "REVERSE LOOKUPS" |
| 41 |
.PP |
| 42 |
PTR records for reverse lookups are generated automatically. |
| 43 |
|
| 44 |
.SH "SYNTAX" |
| 45 |
.PP |
| 46 |
.RS |
| 47 |
|
| 48 |
.nf |
| 49 |
dbhost [FILE] { |
| 50 |
ttl TTL |
| 51 |
} |
| 52 |
|
| 53 |
.fi |
| 54 |
.RE |
| 55 |
|
| 56 |
.IP \(bu 4 |
| 57 |
\fBFILE\fP the hosts file to read and parse. If the path is relative the path from the \fIroot\fP |
| 58 |
handler will be prepended to it. Defaults to\fB\fC/etc/hosts\fR if omitted. |
| 59 |
.IP \(bu 4 |
| 60 |
\fB\fCttl\fR change the \fBTTL\fP of the records generated (forward and reverse). The default is 3600 seconds (1 hour). |
| 61 |
|
| 62 |
|
| 63 |
.SH "EXAMPLES" |
| 64 |
.PP |
| 65 |
Load \fB\fC/etc/hosts\fR file. |
| 66 |
|
| 67 |
.PP |
| 68 |
.RS |
| 69 |
|
| 70 |
.nf |
| 71 |
\&. { |
| 72 |
dbhost |
| 73 |
} |
| 74 |
|
| 75 |
.fi |
| 76 |
.RE |
| 77 |
|
| 78 |
.PP |
| 79 |
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 |
| 80 |
names: |
| 81 |
|
| 82 |
.PP |
| 83 |
.RS |
| 84 |
|
| 85 |
.nf |
| 86 |
example.org { |
| 87 |
dbhost example.hosts |
| 88 |
} |
| 89 |
|
| 90 |
.fi |
| 91 |
.RE |
| 92 |
|
| 93 |
.SH "SEE ALSO" |
| 94 |
.PP |
| 95 |
The form of the entries in the \fB\fC/etc/hosts\fR file are based on IETF RFC |
| 96 |
952 |
| 97 |
\[la]https://tools.ietf.org/html/rfc952\[ra] which was updated by IETF RFC |
| 98 |
1123 |
| 99 |
\[la]https://tools.ietf.org/html/rfc1123\[ra]. |