Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search DNS not working correctly. #13103

Closed
rhatdan opened this issue Feb 1, 2022 · 11 comments · Fixed by #13143
Closed

Search DNS not working correctly. #13103

rhatdan opened this issue Feb 1, 2022 · 11 comments · Fixed by #13143
Assignees
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@rhatdan
Copy link
Member

rhatdan commented Feb 1, 2022

$ podman run -ti alpine ping help
PING help (209.132.183.105): 56 data bytes
64 bytes from 209.132.183.105: seq=0 ttl=42 time=64.800 ms
64 bytes from 209.132.183.105: seq=1 ttl=42 time=123.429 ms
$ podman run -ti alpine ping help.redhat.com
PING help.redhat.com (209.132.183.105): 56 data bytes
64 bytes from 209.132.183.105: seq=0 ttl=42 time=65.246 ms
64 bytes from 209.132.183.105: seq=1 ttl=42 time=64.677 ms
$ podman run -ti --network podman1 alpine ping help.redhat.com
PING help.redhat.com (209.132.183.105): 56 data bytes
64 bytes from 209.132.183.105: seq=0 ttl=42 time=64.744 ms
64 bytes from 209.132.183.105: seq=1 ttl=42 time=66.691 ms

No Work:

$ podman run -ti --network podman1 alpine ping help
ping: bad address 'help'

Aardvark is failing to handle search dns record.

$ cat /etc/resolv.conf 
...
nameserver 127.0.0.53
options edns0 trust-ad
search redhat.com
@flouthoc
Copy link
Collaborator

flouthoc commented Feb 1, 2022

@rhatdan Could you please paste /etc/resolv.conf of container as well. I am assuming that's happening because we only have search dns.podman inside container and it becomes help.dns.podman.

So the request on host is actually goes for help.dns.podman

@flouthoc
Copy link
Collaborator

flouthoc commented Feb 1, 2022

@rhatdan I think behviour is same which happened for dnsname/dnsmasq setup , I am not sure if netavark inherits search domains from host or even if it is supposed to do that.

@Luap99 @mheon Could confirm but afaik neither CNI/netavark inherits search domains of host but i could be wrong.

@rhatdan
Copy link
Member Author

rhatdan commented Feb 1, 2022

Right, if this fails it should be sent out to the network though.
Ok so this is a Podman thing

$ podman run -ti --network podman1 alpine cat /etc/resolv.conf 
search dns.podman
nameserver 10.89.0.1

I think we should continue to use the search domain from the hosts.

@rhatdan
Copy link
Member Author

rhatdan commented Feb 1, 2022

@mheon @baude @Luap99 PTAL

@rhatdan
Copy link
Member Author

rhatdan commented Feb 1, 2022

 $ podman run -ti --dns-search redhat.com --network podman1 alpine ping help
PING help (209.132.183.105): 56 data bytes
64 bytes from 209.132.183.105: seq=0 ttl=42 time=65.609 ms
64 bytes from 209.132.183.105: seq=1 ttl=42 time=66.600 ms
^C
--- help ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 65.609/66.104/66.600 ms

@mheon
Copy link
Member

mheon commented Feb 1, 2022

Concur that this looks like a Podman bug, not aardvark - resolv.conf in the container is not being built correctly

@rhatdan
Copy link
Member Author

rhatdan commented Feb 1, 2022

docker run --network dan alpine cat /etc/resolv.conf 
search redhat.com
nameserver 127.0.0.11
options edns0 trust-ad ndots:0

Looks like docker maintains the search redhat.com from the host.
As well as the options.

@rhatdan rhatdan transferred this issue from containers/aardvark-dns Feb 1, 2022
@flouthoc
Copy link
Collaborator

flouthoc commented Feb 1, 2022

@rhatdan Yes i think this issue is agnostic of netavark or cni and more of podman behavior issue. It seems podman does not inherits host's /etc/resolv.conf , i can reproduce it with CNI as well. Could someone else also confirm if they are able to reproduce this with CNI.

@Luap99
Copy link
Member

Luap99 commented Feb 2, 2022

Yes podman removes the other search domains. I think we have to append them.
IIRC I added this logic originally and just followed the way how it was done for the nameserver ips since we will also remove the other servers.

@Luap99
Copy link
Member

Luap99 commented Feb 2, 2022

I will open a PR

@Luap99 Luap99 self-assigned this Feb 2, 2022
@Luap99 Luap99 added In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/bug Categorizes issue or PR as related to a bug. labels Feb 2, 2022
@Luap99
Copy link
Member

Luap99 commented Feb 2, 2022

When we set --dns 1.1.1.1 should we add our nameserver first or use the one from the user first, same for the search domain?

Luap99 added a commit to Luap99/libpod that referenced this issue Feb 4, 2022
Append the podman dns seach domain to the host search domains when we
use the dnsname/aardvark server. Previously it would only use podman
seach domains and discard the host domains.

Fixes containers#13103

Signed-off-by: Paul Holzinger <[email protected]>
mheon pushed a commit to mheon/libpod that referenced this issue Feb 10, 2022
Append the podman dns seach domain to the host search domains when we
use the dnsname/aardvark server. Previously it would only use podman
seach domains and discard the host domains.

Fixes containers#13103

Signed-off-by: Paul Holzinger <[email protected]>
patrycja-guzik pushed a commit to patrycja-guzik/podman that referenced this issue Feb 15, 2022
Append the podman dns seach domain to the host search domains when we
use the dnsname/aardvark server. Previously it would only use podman
seach domains and discard the host domains.

Fixes containers#13103

Signed-off-by: Paul Holzinger <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants