forked from skonfig/base
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'unbound-ng' into 'master'
__unbound: create more generalized type. See merge request ungleich-public/cdist-contrib!36
- Loading branch information
Showing
10 changed files
with
259 additions
and
1,132 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
#!/bin/sh | ||
|
||
if ! [ -f "${__object:?}/parameter/control-use-certs" ]; | ||
then | ||
exit 0; | ||
fi | ||
|
||
UNBOUND_CERTS_DIR=/etc/unbound | ||
|
||
if [ -f "$__object/parameter/enable-rc" ]; then | ||
if [ -f "${__object:?}/parameter/enable-rc" ]; then | ||
echo "unbound-control-setup -d $UNBOUND_CERTS_DIR" | ||
echo "chown unbound:unbound $UNBOUND_CERTS_DIR/*.pem $UNBOUND_CERTS_DIR/*.key" | ||
fi | ||
|
||
cat << EOF | ||
if pgrep unbound; then | ||
service unbound reload | ||
service ${__object_id:?} reload | ||
else | ||
service unbound start | ||
service ${__object_id:?} start | ||
fi | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,126 @@ | ||
cdist-type__unbound(7) | ||
=============================== | ||
======================= | ||
|
||
NAME | ||
---- | ||
cdist-type__ungleich_unbound - unbound server deployment for ungleich | ||
cdist-type__unbound - configure an instance of unbound, a DNS validating resolver. | ||
|
||
|
||
DESCRIPTION | ||
----------- | ||
This unbound (dns resolver and cache) deployment provides DNS64 and fetch | ||
answers from specified upstrean DNS server. This is a singleton type. | ||
This type writes the configuration and OpenRC init scripts to run an instance | ||
of unbound. The most commonly used options for unbound are configurable through | ||
flags. | ||
|
||
Note that this type is currently only implemented (and tested) on Alpine Linux. | ||
Please contribute other implementations if you can. | ||
|
||
REQUIRED PARAMETERS | ||
------------------- | ||
forward_addr | ||
DNS servers used to lookup names, can be provided multiple times. It can be | ||
either an IPv4 or IPv6 address but no domain name. | ||
|
||
OPTIONAL PARAMETERS | ||
------------------- | ||
verbosity | ||
Control the `unbound.conf(5)` verbosity parameter. | ||
|
||
port | ||
Control the `unbound.conf(5)` port parameter. | ||
|
||
control-port | ||
Control the `unbound.conf(5)` control-port parameter. | ||
|
||
dns64-prefix | ||
Control the `unbound.conf(5)` dns64-prefix parameter. | ||
|
||
OPTIONAL MULTIPLE PARAMETERS | ||
---------------------------- | ||
interface | ||
Interface to listen on, can be provided multiple times. Defaults to | ||
'127.0.0.1' and '::1'. | ||
Control the `unbound.conf(5)` interface parameter. Can be | ||
given multiple times, will generate multiple `interface: | ||
xxx` clauses. | ||
|
||
access-control | ||
Controls which clients are allowed queries to the unbound service (everything | ||
but localhost is refused by default), can be provided multiple times. The | ||
format is described in unbound.conf(5). | ||
|
||
rc-interface | ||
Address or path to socket used for remote control (see `--enable_control`. Defaults to `127.0.0.1`). | ||
Control the `unbound.conf(5)` access-control parameter. Can be given | ||
multiple times, will generate multiple `access-control` clauses. The format | ||
is an IP block followed by an access-control keyword. | ||
|
||
control-interface | ||
Control the `unbound.conf(5)` control-interface parameter. Can be given | ||
mutltiple times, will generate multiple `control-interface` clauses. Note | ||
that without the `enable-rc` boolean flags, remote control will not be | ||
enabled. Note that if at least one control interfaces is not a local socket, | ||
then you should enable the `control-use-certs` boolean flag to generate and | ||
configure TLS certificates for use between `unbound(8)` and | ||
`unbound-control(8)` | ||
|
||
forward-zone | ||
Define a forward zone. Each zone is comprised of a name, which defines for | ||
what domains this zone applies, and at least one DNS server to which the | ||
queries should be forwarded. The format is a comma-separated list of values | ||
where the first element is the name of the zone, and the following elements | ||
are the IP addresses of the DNS servers; e.g. `example.com,1.2.3.4,4.3.2.1` | ||
|
||
local-data | ||
Configure local data, which is served in reply to queries for it. Can be | ||
specified multiple times. | ||
|
||
dns64-prefix | ||
Enable DNS64 with specified prefix. | ||
Control the `unbound.conf(5)` local-data parameter. Note that no local-zone | ||
is defined, so the unbound default is to treat this data as a transparent | ||
local zone. | ||
|
||
BOOLEAN PARAMETERS | ||
------------------ | ||
disable-ip4 | ||
Do not answer or issue queries over IPv4. Cannot be used alongside the | ||
`--disable-ip6` flag. | ||
ip-transparent | ||
Control the `unbound.conf(5)` ip-transparent parameter. | ||
|
||
disable-ip6 | ||
Do not answer or issue queries over IPv6. Cannot be used alongside the | ||
`--disable-ip4` flag. | ||
dns64 | ||
Enables the addition of the DNS64 module. | ||
|
||
enable-rc | ||
Enable remote control (see `unbound-control(8)`). | ||
Enable remote control. | ||
|
||
control-use-certs | ||
Enable the generation using `unbound-control-setup(8)` of TLS certificates | ||
for the interaction between `unbound(8)` and `unbound-control(8)`, as well as | ||
their inclusion in the configuration file. | ||
|
||
disable-ip4 | ||
Disable answering queries over IPv4. | ||
|
||
disable-ip6 | ||
Disable answering queries over IPv6. | ||
|
||
EXAMPLES | ||
-------- | ||
|
||
.. code-block:: sh | ||
__ungleich_unbound \ | ||
--interface '::0' \ | ||
--dns64-prefix '2a0a:e5c0:2:10::/96' \ | ||
--forward-addr '2a0a:e5c0:2:1::5' \ | ||
--forward-addr '2a0a:e5c0:2:1::6' \ | ||
--access-control '::0/0 deny' \ | ||
--access-control '2a0a:e5c0::/29 allow' \ | ||
--access-control '2a09:2940::/29 allow' \ | ||
--ip6 | ||
# Setup two resolvers, one with dns64, the other without. | ||
__unbound unbound \ | ||
--dns64 \ | ||
--ip-transparent \ | ||
--interface "$address" \ | ||
--access-control "$address/64 allow" \ | ||
--enable-rc \ | ||
--control-interface "/var/run/unbound_control.sock" | ||
__unbound unbound6only \ | ||
--ip-transparent \ | ||
--interface "$addresstwo" \ | ||
--access-control "$addresstwo/64 allow" \ | ||
--forward-zone "example.com,1.1.1.1,2.2.2.2" | ||
SEE ALSO | ||
-------- | ||
- `unbound.conf(5) <https://nlnetlabs.nl/documentation/unbound/unbound.conf/>`_ | ||
`unbound(8)` | ||
`unbound.conf(5)` | ||
`unbound-control(8)` | ||
|
||
|
||
AUTHORS | ||
------- | ||
Timothée Floure <timothee.floure@ungleich.ch> | ||
Joachim Desroches <joachim.desroches@epfl.ch> | ||
|
||
|
||
COPYING | ||
------- | ||
Copyright \(C) 2020 Timothée Floure. You can redistribute it | ||
Copyright \(C) 2021 Joachim Desroches. You can redistribute it | ||
and/or modify it under the terms of the GNU General Public License as | ||
published by the Free Software Foundation, either version 3 of the | ||
License, or (at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
disable-ip6 | ||
disable-ip4 | ||
ip-transparent | ||
dns64 | ||
enable-rc | ||
control-use-certs | ||
disable-ip4 | ||
disable-ip6 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
rc-interface | ||
verbosity | ||
port | ||
control-port | ||
dns64-prefix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
interface | ||
access-control | ||
control-interface | ||
forward-zone | ||
local-data | ||
interface |
This file was deleted.
Oops, something went wrong.
Empty file.