diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-03-11 11:42:01 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-03-11 11:42:01 +0100 |
commit | e6139b4824ca6cc3e2c5041121ff43d0cbbcde52 (patch) | |
tree | 37d26a6102d6616122c6d581395ec83eec307f2e /libpod/container_internal_linux.go | |
parent | 06e444124f3b4989481c02c15a2fe1cf7fcb0b61 (diff) | |
download | podman-e6139b4824ca6cc3e2c5041121ff43d0cbbcde52.tar.gz podman-e6139b4824ca6cc3e2c5041121ff43d0cbbcde52.tar.bz2 podman-e6139b4824ca6cc3e2c5041121ff43d0cbbcde52.zip |
slirp4netns: add builtin DNS server to resolv.conf
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r-- | libpod/container_internal_linux.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index c9f35dd75..8ba5272b7 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -835,6 +835,10 @@ func (c *Container) generateResolvConf() (string, error) { // Make a new resolv.conf nameservers := resolvconf.GetNameservers(resolv.Content) + // slirp4netns has a built in DNS server. + if c.config.NetMode.IsSlirp4netns() { + nameservers = append(nameservers, "10.0.2.3") + } if len(c.config.DNSServer) > 0 { // We store DNS servers as net.IP, so need to convert to string nameservers = []string{} |