Setting a name server and a search domain for a running container does not update the content of the file "
/etc/resolv.conf" in the container - the following commands update the configuration file of the container only, and the settings are applied on the container's restart only.
~# vzctl set $CTID --save --nameserver IP.ADD.RE.SS ~# vzctl set $CTID --save --searchdomain domain.tld
- The package "
resolvconf" is installed in the container.
If the package "
resolvconf" is installed, the file "
/etc/resolv.conf" is replaced with a symbolic link pointing to a memory-stored file, and the content of this file is managed by the tool
To propagate settings in this case, the information about name servers and search domains is stored in the file "
The support of
resolvconf was added in the scope of the request PSBM-22822.
1 .To apply the changes, run the following command:
~# vzctl exec $CTID resolvconf -u
To apply changes to containers automatically, add the following lines in the script "
/etc/sysconfig/vz-scripts/dists/scripts/set_dns.sh", to the very end of the function "
if which resolvconf >/dev/null 2>&1 && runlevel >/dev/null 2>&1; then resolvconf -u >/dev/null 2>&1 fi