resolve Plugin
Purpose
The resolve plugin for libcharon writes name servers to resolv.conf.
It is enabled by default but may be disabled with the
./configure option
--disable-resolve
Behavior
Name servers received via CP configuration payloads (IKEv2) or via
Mode Config (IKEv1) are added to /etc/resolv.conf or installed via
resolvconf(8). When the connection goes down name servers are automatically
removed again.
Configuration
The resolve plugin is configured using the following options in the
charon.plugins.resolve
section of strongswan.conf:
| Key | Default | Description |
|---|---|---|
file |
[→] |
File where name servers are written to if not using |
resolvconf.iface |
[→] |
The interface name and protocol sent to |
resolvconf.path |
[→] |
Path/command for |
Support for resolvconf(8)
strongSwan provides support for installing name servers via the
resolvconf framework (or e.g. the implementation provided by
systemd’s resolvectl). If resolvconf is found or its path is explicitly
configured, the plugin automatically invokes it appropriately instead of
modifying resolv.conf directly.
Prior to version 5.9.9, the plugin installed every name server separately and
generated unique interface names by adding the IP address of the name server to
a prefix (configured in the now removed resolvconf.iface_prefix option).
Since version 5.9.9, all name servers are installed and associated with a
single, configurable interface/protocol name (resolvconf.iface). If multiple
name servers are assigned, resolvconf will be invoked multiple times but
each will receive all name servers available at the time.