Skip to content

Commit

Permalink
Merge pull request #17578 from Luap99/netavark-dns
Browse files Browse the repository at this point in the history
netavark: only use aardvark ip as nameserver
  • Loading branch information
openshift-merge-robot authored Feb 22, 2023
2 parents 44bd6dd + 9dc730d commit 38c9194
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion libpod/container_internal_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -2046,7 +2046,11 @@ func (c *Container) generateResolvConf() error {
// If the user provided dns, it trumps all; then dns masq; then resolv.conf
keepHostServers := false
if len(nameservers) == 0 {
keepHostServers = true
// when no network name servers or not netavark use host servers
// for aardvark dns we only want our single server in there
if len(networkNameServers) == 0 || networkBackend != string(types.Netavark) {
keepHostServers = true
}
// first add the nameservers from the networks status
nameservers = networkNameServers
// slirp4netns has a built in DNS forwarder.
Expand Down
2 changes: 1 addition & 1 deletion test/system/500-networking.bats
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ EOF
is "$output" "search example.com.*" "correct search domain"
local store=$output
if is_netavark; then
is "$store" ".*nameserver $subnet.1.*" "integrated dns nameserver is set"
assert "$store" == "search example.com${nl}nameserver $subnet.1" "only integrated dns nameserver is set"
else
is "$store" ".*nameserver 1.1.1.1${nl}nameserver $searchIP${nl}nameserver 1.0.0.1${nl}nameserver 8.8.8.8" "nameserver order is correct"
fi
Expand Down

0 comments on commit 38c9194

Please sign in to comment.