summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-06-12 10:29:54 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-06-12 10:29:57 +0200
commit0e34d9093e92aea1a1ba2cd360246c8e938e5374 (patch)
tree96bc763b0f9a18c17d366179ef555ac9e9f4423a /libpod
parentd4681fafe55340043fa421ae31b98681dd6902c4 (diff)
downloadpodman-0e34d9093e92aea1a1ba2cd360246c8e938e5374.tar.gz
podman-0e34d9093e92aea1a1ba2cd360246c8e938e5374.tar.bz2
podman-0e34d9093e92aea1a1ba2cd360246c8e938e5374.zip
rootless: use the slirp4netns builtin DNS first
When using slirp4netns, be sure the built-in DNS server is the first one to be used. Closes: https://github.com/containers/libpod/issues/3277 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_internal_linux.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index 4acc77afa..0be5427d9 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -1000,7 +1000,7 @@ func (c *Container) generateResolvConf() (string, error) {
nameservers := resolvconf.GetNameservers(resolv.Content)
// slirp4netns has a built in DNS server.
if c.config.NetMode.IsSlirp4netns() {
- nameservers = append(nameservers, "10.0.2.3")
+ nameservers = append([]string{"10.0.2.3"}, nameservers...)
}
if len(c.config.DNSServer) > 0 {
// We store DNS servers as net.IP, so need to convert to string