Anyone can help me? I don't understand why I can not resolve public domains like http://google.com inside a container when using a user-defined bridge network on docker.
Check out/etc/resolv.conf inside the container
thanks, it points to the docker internal dns which should in theory forward the request to the host (where it works), but it does not resolve unfortunately
You can try to query that resolver manually. Or adjust it to point to a proper external resolver and see if that helps.
You can have a look at this too: https://serverfault.com/a/918568/402267
Thanks for your help! I activated debug in docker daemon and it's obvious that the dns request is forwarded to the correct dns server:
Dec 14 11:12:23 odoo-0 env[6255]: time="2023-12-14T11:12:23.570729313Z" level=debug msg="Name To resolve: google.com."
Dec 14 11:12:23 odoo-0 env[6255]: time="2023-12-14T11:12:23.570855214Z" level=debug msg="[resolver] query . (AAAA) from 172.16.0.2:41603, forwarding to udp:168.63.129.16"
Dec 14 11:12:23 odoo-0 env[6255]: time="2023-12-14T11:12:23.570730313Z" level=debug msg="Name To resolve: google.com."
Dec 14 11:12:23 odoo-0 env[6255]: time="2023-12-14T11:12:23.570996216Z" level=debug msg="[resolver] query . (A) from 172.16.0.2:53161, forwarding to udp:168.63.129.16"
Dec 14 11:12:26 odoo-0 env[6255]: time="2023-12-14T11:12:26.073538642Z" level=debug msg="Name To resolve: google.com."
Dec 14 11:12:26 odoo-0 env[6255]: time="2023-12-14T11:12:26.073727044Z" level=debug msg="[resolver] query . (AAAA) from 172.16.0.2:59965, forwarding to udp:168.63.129.16"
Dec 14 11:12:26 odoo-0 env[6255]: time="2023-12-14T11:12:26.073544742Z" level=debug msg="Name To resolve: google.com."
Dec 14 11:12:26 odoo-0 env[6255]: time="2023-12-14T11:12:26.073861346Z" level=debug msg="[resolver] query . (A) from 172.16.0.2:47119, forwarding to udp:168.63.129.16"
Dec 14 11:12:27 odoo-0 env[6255]: time="2023-12-14T11:12:27.571517726Z" level=debug msg="[resolver] read from DNS server failed, read udp 172.16.0.2:53161->168.63.129.16:53: i/o timeout"
Dec 14 11:12:27 odoo-0 env[6255]: time="2023-12-14T11:12:27.571537126Z" level=debug msg="[resolver] read from DNS server failed, read udp 172.16.0.2:41603->168.63.129.16:53: i/o timeout"
Dec 14 11:12:30 odoo-0 env[6255]: time="2023-12-14T11:12:30.074612042Z" level=debug msg="[resolver] read from DNS server failed, read udp 172.16.0.2:47119->168.63.129.16:53: i/o timeout"
Dec 14 11:12:30 odoo-0 env[6255]: time="2023-12-14T11:12:30.074642942Z" level=debug msg="[resolver] read from DNS server failed, read udp 172.16.0.2:59965->168.63.129.16:53: i/o timeout" https://learn.microsoft.com/en-us/azure/virtual-network/what-is-ip-address-168-63-129-16
I would try to ping that server from within the container and see if you can reach it
It's presumably something specific to Azure
> • Enables communication with the DNS virtual server to provide filtered name resolution to the resources (such as VM) that don't have a custom DNS server. This filtering makes sure that customers can resolve only the hostnames of their resources.
yeah, ping works and netcat on port 53 as well. so should be good with some dns-tweaking. will try that. Thanks!