| 1 |
<?xml version='1.0'?> |
| 2 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
| 3 |
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> |
| 4 |
<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
| 5 |
|
| 6 |
<refentry id="systemd.rr" |
| 7 |
xmlns:xi="http://www.w3.org/2001/XInclude" |
| 8 |
conditional='ENABLE_RESOLVE'> |
| 9 |
|
| 10 |
<refentryinfo> |
| 11 |
<title>systemd.rr</title> |
| 12 |
<productname>systemd</productname> |
| 13 |
</refentryinfo> |
| 14 |
|
| 15 |
<refmeta> |
| 16 |
<refentrytitle>systemd.rr</refentrytitle> |
| 17 |
<manvolnum>5</manvolnum> |
| 18 |
</refmeta> |
| 19 |
|
| 20 |
<refnamediv> |
| 21 |
<refname>systemd.rr</refname> |
| 22 |
<refpurpose>Local static DNS resource record definitions</refpurpose> |
| 23 |
</refnamediv> |
| 24 |
|
| 25 |
<refsynopsisdiv> |
| 26 |
<para><simplelist> |
| 27 |
<member><filename>/etc/systemd/resolve/static.d/*.rr</filename></member> |
| 28 |
<member><filename>/run/systemd/resolve/static.d/*.rr</filename></member> |
| 29 |
<member><filename>/usr/local/lib/systemd/resolve/static.d/*.rr</filename></member> |
| 30 |
<member><filename>/usr/lib/systemd/resolve/static.d/*.rr</filename></member> |
| 31 |
</simplelist></para> |
| 32 |
</refsynopsisdiv> |
| 33 |
|
| 34 |
<refsect1> |
| 35 |
<title>Description</title> |
| 36 |
|
| 37 |
<para><filename>*.rr</filename> files may be used to define resource record sets ("RRsets") that shall be |
| 38 |
resolvable locally, similar in style to address records defined by <filename>/etc/hosts</filename> (see |
| 39 |
<citerefentry><refentrytitle>hosts</refentrytitle><manvolnum>5</manvolnum></citerefentry> for |
| 40 |
details). These files are read by |
| 41 |
<citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
| 42 |
and are used to synthesize local responses to local queries matching the defined resource record set.</para> |
| 43 |
|
| 44 |
<para>These drop-in files are in JSON format. Each file may either contain a single top-level DNS RR |
| 45 |
object, or an array of one or more DNS RR objects. Each RR object has at least a <literal>key</literal> |
| 46 |
subobject consisting of a <literal>name</literal> string field and a <literal>type</literal> integer |
| 47 |
field (which contains the RR type in numeric form). Depending on the chosen type the RR object also has |
| 48 |
the following fields:</para> |
| 49 |
|
| 50 |
<itemizedlist> |
| 51 |
<listitem><para>For A/AAAA RRs, the RR object should have an <literal>address</literal> field set to |
| 52 |
either an IP address formatted as string, or an array consisting of 4 or 16 8-bit unsigned integers for |
| 53 |
the IP address.</para></listitem> |
| 54 |
|
| 55 |
<listitem><para>For PTR/NS/CNAME/DNAME RRs, the RR object should have a <literal>name</literal> field |
| 56 |
set to the name the record shall point to.</para></listitem> |
| 57 |
</itemizedlist> |
| 58 |
|
| 59 |
<para>This JSON serialization of DNS RRs matches the one returned by <command>resolvectl</command>.</para> |
| 60 |
|
| 61 |
<para>Currently no other RR types are supported.</para> |
| 62 |
</refsect1> |
| 63 |
|
| 64 |
<refsect1> |
| 65 |
<title>Examples</title> |
| 66 |
<example> |
| 67 |
<title>Simple A Record</title> |
| 68 |
<para>To make local address lookups for <literal>foobar.example.com</literal> resolve to the |
| 69 |
192.168.100.1 IPv4 address, create |
| 70 |
<filename>/run/systemd/resolve/static.d/foobar_example_com.rr</filename>: |
| 71 |
|
| 72 |
<programlisting> |
| 73 |
{ |
| 74 |
"key" : { |
| 75 |
"type" : 1, |
| 76 |
"name" : "foobar.example.com" |
| 77 |
}, |
| 78 |
"address" : [ 192, 168, 100, 1 ] |
| 79 |
}</programlisting></para> |
| 80 |
|
| 81 |
</example> |
| 82 |
</refsect1> |
| 83 |
|
| 84 |
<refsect1> |
| 85 |
<title>See Also</title> |
| 86 |
<para><simplelist type="inline"> |
| 87 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 88 |
<member><citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 89 |
<member><citerefentry><refentrytitle>resolved.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> |
| 90 |
<member><citerefentry><refentrytitle>hosts</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> |
| 91 |
<member><citerefentry><refentrytitle>resolvectl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 92 |
</simplelist></para> |
| 93 |
</refsect1> |
| 94 |
|
| 95 |
</refentry> |