custom fact to know resolver
With Ubuntu1804 systemd-resolved.service
manage the file /etc/resolv.conf
.
By default, systemd-resolved
uses nameserver 127.0.0.53
. systemd-resolved
provides a local DNS stub listener on IP address 127.0.0.53 on the local loopback interface. So inside the container, the ip address is 127.0.0.53
can not be used and DNS resolution does not work.
The file /etc/resolv.conf
is a link to ../run/systemd/resolve/stub-resolv.conf
.
But systemd-resolved
maintains also /usr/lib/systemd/resolv.conf
file for compatibility with traditional Linux programs. This file may be symlinked from /etc/resolv.conf
and is always kept up-to-date, containing information about all known DNS servers.