-
Notifications
You must be signed in to change notification settings - Fork 86
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 Not Resolving under Network [CentOS8] #957
Comments
me too! Output of Output of
Output of
Output of
Output of
|
Hi. Probably the reason is https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/8.0_release_notes/rhel-8_0_0_release#networking I have the same issue at Fedora 32: |
me too! same problem on CentOS 8, all my docker-compose containers are with a dead Internet. |
fast workaround it should help you work with docker but I advise rollback when docker will fix this |
@lfiraza |
@lfiraza thanks dude, it's worked for me. |
@lfiraza added a link to your comment in the OP, in case anymore people see this. I switched back to centos 7 in the meantime. |
@lfiraza That's work! Thank you very much. <3 |
@lfiraza thanks friend, this save my day. I spent almost 24 hrs on this. Finally I came here and this works |
@lfiraza Thanks very much! It works!! |
@lfiraza Thank you very much. It works for me as well. I was having issues with running Terraform from a docker container running on centos 8 host. Tried different steps including adding custom DNS, adding docker interface to trusted on firewall... but only the solution provided by you worked. Now I can run Terraform commands from my docker container.... |
@lfiraza thank you. I couldn't build a ubuntu18 docker image because I was getting |
@lfiraza Thanks very much. You saved my day! |
full diff: moby/libnetwork@2e24aed...9e99af2 - moby/libnetwork#2548 Add docker interfaces to firewalld docker zone - fixes docker/for-linux#957 DNS Not Resolving under Network [CentOS8] - fixes moby/libnetwork#2496 Port Forwarding does not work on RHEL 8 with Firewalld running with FirewallBackend=nftables - store.getNetworksFromStore() remove unused error return - moby/libnetwork#2554 Fix 'failed to get network during CreateEndpoint' - fixes/addresses docker/for-linux#888 failed to get network during CreateEndpoint - moby/libnetwork#2558 [master] bridge: disable IPv6 router advertisements - moby/libnetwork#2563 log error instead if disabling IPv6 router advertisement failed - fixes docker/for-linux#1033 Shouldn't be fatal: Unable to disable IPv6 router advertisement: open /proc/sys/net/ipv6/conf/docker0/accept_ra: read-only file system Signed-off-by: Sebastiaan van Stijn <[email protected]>
Yo, seriously, thank you, I think I tried everything else till I stumbled on this. You should like ... work for NASA or SpaceX :) |
@lfiraza THANK YOU. Took forever to find this. |
lfiraza's workaround works fine. (1) just use masquerade will make this work (recommand)
from robos's comment in <https://linuxconfig.org/how-to-install-docker-in-rhel-8 > (2)set docker0 to trusted (this will open all the ports published by docker)
|
full diff: moby/libnetwork@2e24aed...9e99af2 - moby/libnetwork#2548 Add docker interfaces to firewalld docker zone - fixes docker/for-linux#957 DNS Not Resolving under Network [CentOS8] - fixes moby/libnetwork#2496 Port Forwarding does not work on RHEL 8 with Firewalld running with FirewallBackend=nftables - store.getNetworksFromStore() remove unused error return - moby/libnetwork#2554 Fix 'failed to get network during CreateEndpoint' - fixes/addresses docker/for-linux#888 failed to get network during CreateEndpoint - moby/libnetwork#2558 [master] bridge: disable IPv6 router advertisements - moby/libnetwork#2563 log error instead if disabling IPv6 router advertisement failed - fixes docker/for-linux#1033 Shouldn't be fatal: Unable to disable IPv6 router advertisement: open /proc/sys/net/ipv6/conf/docker0/accept_ra: read-only file system Signed-off-by: Sebastiaan van Stijn <[email protected]> Upstream-commit: 219e7e7ddcf5f0314578d2a517fc0832f03622c1 Component: engine
Confirmed that firewall-cmd --zone=public --add-masquerade --permanent works on CentOS 8. Thanks for this fix, I wanted to mess around with nftables since that apparently is the standard going forward. Thanks for the two additional fixes! |
@lfiraza Thanks for this information. I checked the two fixes with busybox container . Here is how I test this: this command could be useful with docker test, both ways work fine
I tested docker-compose with a simple docker-compose.yml: version: "3"
services:
test:
image: busybox Steps: 1.clean the tow fixes
2.apply one of the fixes
3.use docker-compose to run busybox nslookup
My environment: docker-compose version 1.26.2 |
Thank you very much for solving this issue, Centos8 has caused me a lot of trouble, I don't know why use nftables instead of iptables? why use dnf instead of yum? |
uhyooooooooooooooooo! |
Same problem here. After some research I found that DNS requests from the docker to my DNS server where arriving with the internal docker ip (172.16.0.2) as source address (instead of using the ip address of the docker host network interface). In my case, SNAT was failing only for DNS traffic (could ping 8.8.8.8 from inside the container). Proposed solutions did work for me too. Many thanks! |
@lfiraza a lifesaver, THANK YOU!! FYI this also works to fix broken LXC container DNS name resolution and networking inside LXC containers on Linux 8 distros for LXC as well when containers are using iptables rules with physical interfaces. Symptoms of my LXC containers on Oracle Linux 8 before the FirewallBackend=iptables fix were ping of external internet addresses from inside LXC container was working but DNS resolution from inside container was not working. As noted above by other commenters, there are ways to make this work without disabling nftables. I have tried them with LXC containers and they do work too. |
Same issue, same resolving ! Thanks a lot! |
What to do on MacOS? |
Edit: There's a workaround in the comments below.
Ok so I have a fresh install of CentOS8, Docker, Docker compose. I'm trying to run Traefik. Created my network with
docker create network proxy
, attached it to my docker-compose file, ran my scripts, and it works. Kinda.If I run a container with
--net=host
everything works fine. However, any other network I create does not resolve DNSExpected behavior
Actual behavior
I repeat: If I run a container with
--net=host
everything works fine. However, any other network I create does not resolve DNSSteps to reproduce the behavior
I'm running a CentOS 8 VPS on Hetzner Cloud with the latest version of Docker (as of yesterday). The issue just "happened".
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.)
Hetzner Cloud
The text was updated successfully, but these errors were encountered: