diff --git a/libpod/networking_common.go b/libpod/networking_common.go index ac914493b2..816e1d1c08 100644 --- a/libpod/networking_common.go +++ b/libpod/networking_common.go @@ -39,9 +39,15 @@ func (c *Container) convertPortMappings() []types.PortMapping { } func (c *Container) getNetworkOptions(networkOpts map[string]types.PerNetworkOptions) types.NetworkOptions { + nameservers := make([]string, 0, len(c.runtime.config.Containers.DNSServers)+len(c.config.DNSServer)) + nameservers = append(nameservers, c.runtime.config.Containers.DNSServers...) + for _, ip := range c.config.DNSServer { + nameservers = append(nameservers, ip.String()) + } opts := types.NetworkOptions{ ContainerID: c.config.ID, ContainerName: getNetworkPodName(c), + DNSServers: nameservers, } opts.PortMappings = c.convertPortMappings()