resolved
Version information
This version is compatible with:
- Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x
- Puppet >= 6.21.0 < 8.0.0
- , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'devalone-resolved', '1.1.5'
Learn more about managing modules with a PuppetfileDocumentation
resolved
Manage the /etc/systemd/resolved.conf file content, and the /etc/resolv.conf simbol link to instruct systemd-resolved.service using the indicated private, and/or public dns server(s).
Table of Contents
Description
The resolved module configures the /etc/systemd/resolved.conf file content, and the /etc/resolv.conf simbol link, manages the systemd-resolved service to use the indicated private, and/or publice dns server(s).
Setup
What resolved affects
-
This module alters the /etc/systemd/resolved.conf file contents, and alters the /etc/resolv.conf symbol link target to /run/systemd/resolve/resolv.conf.
-
The
dns
parameter is a space-separated list of IPv4 and IPv6 addresses to use as system DNS servers. The ip addresses in this list up to three, the extra ip addresses are ignored.
Beginning with resolved
include resolved
is enough to get you up and running, this uses the default parameters to run resolved module. To pass in parameters specifying which dns server(s) to use:
class { 'resolved':
dns => '192.168.0.2 211.137.160.5',
}
NOTE: In this example, 192.168.0.2
is the local network dns server ip, and 211.137.160.5
is the public dns server ip address.
Usage
All parameters for the resolved module are contained within the main resolved
class, so for any function of the module, set the options you want. See the common usages below for examples.
Using default parameters
include resolved
I want use my own local network dns server
class { 'resolved':
dns => '192.168.0.2',
}
I want use my own local network dns server, and public dns
set two or three dns servers: one or two for local network dns server, other(s) for public dns.
class { 'resolved':
dns => '192.168.0.2 211.137.160.5',
}
Install resolved
module on the same machine which the dns server running
If you install resolved
module on the samle machine which the dns server installed, set dns_stub_listener
parameter to 'no', because they may listen on the same dns default netword port: 53.
class { 'resolved':
dns => '192.168.0.2',
dns_stub_listener => 'no',
}
Reference
See REFERENCE.md
Limitations
This module has been tested on Open Source Puppet 7. It is tested on ubuntu 20.04.
For an extensive list of supported operating systems, see metadata.json
Development
github https://github.com/dearall/devalone-resolved
Release Notes
2021-10-18, version 1.0.0 released. 2021-10-19, version 1.1.0 released. 2021-11-02, version 1.1.4 released. 2021-11-02, version 1.1.5 released.
Reference
Table of Contents
Classes
resolved
: Config the /etc/systemd/resolved.conf and /etc/resolv.conf simbol link to instruct systemd-resolved.service using dns server(s).
Classes
resolved
Config the /etc/systemd/resolved.conf and /etc/resolv.conf simbol link to instruct systemd-resolved.service using dns server(s).
- See also
- resolved.conf(5)
- for details
- resolved.conf(5)
Examples
class { 'resolved':
dns => '192.168.0.2 211.137.160.5',
domains => 'sansovo.org',
dns_stub_listener => 'yes',
cache => 'no-negative',
}
Parameters
The following parameters are available in the resolved
class:
dns
fallback_dns
domains
llmnr
multicast_dns
dnssec
dns_over_tls
cache
dns_stub_listener
read_etc_hosts
dns
Data type: Optional[String]
A space-separated list of IPv4 and IPv6 addresses to use as system DNS servers. DNS requests are sent to one of the listed DNS servers in parallel to suitable per-link DNS servers acquired from systemd-networkd.service(8) or set at runtime by external applications..
Default value: undef.
fallback_dns
Data type: Optional[String]
A space-separated list of IPv4 and IPv6 addresses to use as the fallback DNS servers. Any per-link DNS servers obtained from systemd- networkd.service(8) take precedence over this setting, as do any servers set via DNS= above or /etc/resolv.conf. This setting is hence only used if no other DNS server information is known. If this option is not given, a compiled-in list of DNS servers is used instead.
Default value: undef.
domains
Data type: Optional[String]
A space-separated list of domains. These domains are used as search suffixes when resolving single-label host names (domain names which contain no dot), in order to qualify them into fully-qualified domain names (FQDNs).
Default value: undef.
llmnr
Data type: Optional[Variant[Boolean, Enum['yes','no','resolve']]]
Takes a boolean argument or "resolve". Controls Link-Local Multicast Name Resolution support (RFC 4795[1]) on the local host. If true, enables full LLMNR responder and resolver support. If false, disables both. If set to "resolve", only resolution support is enabled, but responding is disabled.Takes a boolean argument or "resolve". Controls Link-Local Multicast Name Resolution support (RFC 4795[1]) on the local host. If true, enables full LLMNR responder and resolver support. If false, disables both. If set to "resolve", only resolution support is enabled, but responding is disabled.
Default value: 'no'.
multicast_dns
Data type: Optional[Variant[Boolean, Enum['yes','no','resolve']]]
Takes a boolean argument or "resolve". Controls Multicast DNS support (RFC 6762[2]) on the local host. If true, enables full Multicast DNS responder and resolver support. If false, disables both. If set to "resolve", only resolution support is enabled, but responding is disabled. Note that systemd-networkd.service(8) also maintains per-link Multicast DNS settings. Multicast DNS will be enabled on a link only if the per-link and the global setting is on. Default is 'no'.
Default value: 'no'.
dnssec
Data type: Optional[Variant[Boolean, Enum['yes','no','allow-downgrade']]]
Takes a boolean argument or "allow-downgrade". If true all DNS lookups are DNSSEC-validated locally (excluding LLMNR and Multicast DNS). If the response to a lookup request is detected to be invalid a lookup failure is returned to applications. Note that this mode requires a DNS server that supports DNSSEC. If the DNS server does not properly support DNSSEC all validations will fail. If set to "allow-downgrade" DNSSEC validation is attempted, but if the server does not support DNSSEC properly, DNSSEC mode is automatically disabled. Note that this mode makes DNSSEC validation vulnerable to "downgrade" attacks, where an attacker might be able to trigger a downgrade to non-DNSSEC mode by synthesizing a DNS response that suggests DNSSEC was not supported. If set to false, DNS lookups are not DNSSEC validated. Note that DNSSEC validation requires retrieval of additional DNS data, and thus results in a small DNS look-up time penalty. DNSSEC requires knowledge of "trust anchors" to prove data integrity. The trust anchor for the Internet root domain is built into the resolver, additional trust anchors may be defined with dnssec-trust-anchors.d(5).
Default value: 'no'.
dns_over_tls
Data type: Optional[Variant[Boolean, Enum['yes','no','opportunistic']]]
Takes a boolean argument or "opportunistic". If true all connections to the server will be encrypted. Note that this mode requires a DNS server that supports DNS-over-TLS and has a valid certificate for it's IP. If the DNS server does not support DNS-over-TLS all DNS requests will fail. When set to "opportunistic" DNS request are attempted to send encrypted with DNS-over-TLS. If the DNS server does not support TLS, DNS-over-TLS is disabled. Notethat this mode makes DNS-over-TLS vulnerable to "downgrade" attacks, where an attacker might be able to trigger a downgrade to non-encrypted mode by synthesizing a response that suggests DNS-over-TLS was not supported. If set to false, DNS lookups are send over UDP.
Note that DNS-over-TLS requires additional data to be send for setting up an encrypted connection, and thus results in a small DNS look-up time penalty.
Note that in "opportunistic" mode the resolver is not capable of authenticating the server, so it is vulnerable to "man-in-the-middle" attacks.
Server Name Indication (SNI) can be used when opening a TLS connection. Entries in DNS= should be in format "address#server_name".
In addition to this global DNSOverTLS setting systemd-networkd.service(8) also maintains per-link DNSOverTLS settings. For system DNS servers (see above), only the global DNSOverTLS setting is in effect. For per-link DNS servers the per-link setting is in effect, unless it is unset in which case the global setting is used instead.
Default value: 'no'.
cache
Data type: Optional[Variant[Boolean, Enum['yes','no','no-negative']]]
Takes a boolean or "no-negative" as argument. If "yes", resolving a domain name which already got queried earlier will return the previous result as long as it is still valid, and thus does not result in a new network request. Be aware that turning off caching comes at a performance penalty, which is particularly high when DNSSEC is used.
If "no-negative" (the default), only positive answers are cached.
Note that caching is turned off implicitly if the configured DNS server is on a host-local IP address (such as 127.0.0.1 or ::1), in order to avoid duplicate local caching.
Default value: 'no-negative'
dns_stub_listener
Data type: Optional[Variant[Boolean, Enum['yes','no','udp', 'tcp']]]
Takes a boolean argument or one of "udp" and "tcp". If "udp", a DNS stub resolver will listen for UDP requests on address 127.0.0.53 port 53. If "tcp", the stub will listen for TCP requests on the same address and port. If "yes" (the default), the stub listens for both UDP and TCP requests. If "no", the stub listener is disabled.
Note that the DNS stub listener is turned off implicitly when its listening address and port are already in use.
Default value: 'yes'
read_etc_hosts
Data type: Optional[Variant[Boolean, Enum['yes','no']]]
Takes a boolean argument. If "yes" (the default), the DNS stub resolver will read /etc/hosts, and try to resolve hosts or address by using the entries in the file before sending query to DNS servers.
Default value: 'yes'