-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
dns resolver doesn't work for nginx #14356
Comments
I have no idea about the nginx options. If normal dns works then this is not an issue with podman. I see you use cni you may want to test with netavark/aardvark-dns instead which should have better dns support. |
I think I have a similar issue where the nginx lookup occasionally fails with podman 4.1.0 and netavark, but not always: ex:
nginx is configured to use the resolver settings from /etc/resolv.conf and resolver looks like this:
Edit: result from dig, with two ips:
I think I ended up in a situation where an old dns record was not removed up, causing nginx resolver to fail occasionally, in case anyone else ends up in a similar situation. Will open an issue if I can repro this consistently. |
Definitely seeing this. I'm working with a pretty basic Nginx reverse proxy + standalone apps on CentOS Stream 9. Structurally similar to a few Docker compose apps and a FreeBSD jail setup, and I've never seen anything even vaguely like this. podman network reload sometimes helps some hostnames resolve properly, but it's doing weird stuff like resolving internal container names to my external IP address (!). This is on top of all sorts of other weird problems like port forwarding breaking if you attach a container to two networks, which makes me think podman networks are just broken. When I have some time I'm going to reproduce this issue in a VM and reopen this. |
If you encounter this issue while using aardvark-dns, it can be caused by containers/aardvark-dns#203, fixed in aardvark-dns 1.2.0. |
/kind bug
Description
Steps to reproduce the issue:
create two containers in the same network, at least one of them is nginx
check DNS name resolver in the containers
use the checked resolver IP address and DNS names in "resolver" and "set" option in nginx.conf for proxy_pass
Describe the results you received:
DNS works, I can use commands like ping, getent, nslookup, dig. Everything looks ok,
still nginx fails with error:
Describe the results you expected:
it should work, as it works with docker, where resolver is 127.11
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
I use docker-compose with podman uds
I use external network to be able to provide the gateway (DNS) info for the containers:
Everything looks fine for me...
but...
I have no idea what's the difference between my tests and nginx method to use DNS resolver.
Maybe it's not a podman issue, but it works with docker. Teh anv var DNS_SUFFIX is empty for docker, also GATEWAY is 127.11
The text was updated successfully, but these errors were encountered: