You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: internal DNS does not work (clean install) #856
If possible, I've reproduced the issue using the 'main' branch of this project
Steps to reproduce
Last week I had a setup where internal DNS worked pretty well. I wiped my device and did a clean reinstallation of container 0.6.0 (and also tested a debug build on the latest github code)
I run :
container run -d --rm --name web nginx
container run -it --rm alpine sh
/ # ping web
ping: bad address 'web'
/ # ping -4 web
ping: bad address 'web'
/ # nslookup web
Server: 192.168.2.1
Address: 192.168.2.1:53
** server can't find web: NXDOMAIN
** server can't find web: NXDOMAIN
/ # nslookup google.com
Server: 192.168.2.1
Address: 192.168.2.1:53
Non-authoritative answer:
Name: google.com
Address: 142.250.64.174
Non-authoritative answer:
Name: google.com
Address: 2607:f8b0:4008:815::200e
Yes I also tried debian , same behavior unfortunately. I am looking for a way to debug this further as it remains a mystery why this was working properly last week and as this is such a basic scenario, I must be doing something wrong on my machine
sudo container system dns create mycorp
container system property set dns.domain mycorp
After a couple of hours trial and error today the lines above is what makes it work. I must have had that done during my initial testing (before wiping the device). Not sure it's in the docs yet but it definately should be in there as users might expect inter-container dns working out of the box
I ran into the same thing. Setting those properties got the containers talking to each other, but I later had to remove them when building images. With the custom DNS domain set, connections from inside the containers couldn’t reach the outside world.
Clearing those settings fixed it for me:
container system property clear dns.domain
sudo container system dns rm mycorp
container system stop && container system start
For now, it looks like I need to toggle these settings depending on whether I’m building images or running containers.
This is bizarre to read, because at my employer I'm trying to do apt update from within an ubuntu container and the container can't resolve anything no matter what I do, and it doesn't matter if I'm building a container or running one. other tools which use MacOS Linux VMs (outside of container entirely) can use DNS just fine. it's like the host OS is blocking DNS resolution for things running inside container and nothing else, and I don't understand how that can happen. running version 0.7.0.
That answers it for me. Zscaler is bound to that port.
I was running this command because I found #402 and read through it and sure enough, something is using port 53.
Zscaler is ... the worst. It breaks everything.
For those that don't know, Zscaler is a MITM cloud proxy which intercepts every HTTPS request, decrypts it, logs the requests, re-encrypts and passes it on to the server you were trying to reach as an HTTP client. it rewrites requests and responses according to rules and basically usurps TLS and makes the entire TLS superstructure of the web pointless.
@jglogan I answered above if you didn't already see. I can work around Zscaler with the --dns parameter for container run but that doesn't help one container resolve another. fortunately, I almost never need to do this.
Zscaler, dnsmasq, or anything else listening on port 53 creates a situation where the macOS DNS service can't start its listener on that port. Unfortunately, this behavior isn't something we have control over.
I've created apple/containerization#436 for one possible workaround for this issue. Should we do that we can then create an issue here to plumb the feature up into container run.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
container 37587 someuser 12u IPv4 0x5073de1ed066b2f1 0t0 UDP localhost:lot105-ds-upd
All my container's DNS seems to resolve at the moment… It's good but I've no idea why.
BTW, when I ping each of them one after each other, one did not resolve at first, and when I tried a second time after about a minute, it did…
Anyway, I've the feeling the next time I'll start a container, all of this won't work anymore.
[Edit] I was right (kind of). Less than 10s after successfully testing again pinging my DNS after this post, nothing was resolving anymore. But contrary to my feeling, it was even without a single action from me in between BTW.
After a couple of weeks of testing, the DNS behaviour is flaky at best. After a reboot and starting all containers everything works but after "some" time thing just start to break down. Internal DNS resolving from within the containers no longer work.
scutil :
resolver #8
domain : eva
search domain[0] : eva
nameserver[0] : 127.0.0.1
port : 2053
flags : Request A records, Request AAAA records
reach : 0x00030002 (Reachable,Local Address,Directly Reachable Address)`
lsof -i :53
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mDNSRespo 184 _mdnsresponder 20u IPv4 0x35e752c7b6a56472 0t0 UDP *:domain
mDNSRespo 184 _mdnsresponder 21u IPv6 0x91983a720e3b082a 0t0 UDP *:domain
mDNSRespo 184 _mdnsresponder 22u IPv4 0xe2b62073f159a240 0t0 TCP *:domain (LISTEN)
mDNSRespo 184 _mdnsresponder 23u IPv6 0x350a10b46199942d 0t0 TCP *:domain (LISTEN)
sudo lsof -i :2053
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
container 528 root 14u IPv4 0x56db5926a6f26806 0t0 UDP localhost:lot105-ds-upd
@jglogan any ideas on what I can do to pinpoint the cause of this?
I'm having a similar issue when building an image. No 3rd party DNS services involved. Before container system start, no one is listening on port 53.
container system status
apiserver is not running and not registered with launchd
sudo lsof -i :53
<nothing>
Starting the container.
container system start
Verifying apiserver is running...
container system status
apiserver is running
application data root: /Users/.../Library/Application Support/com.apple.container/
application install root: /usr/local/
container-apiserver version: container-apiserver version 0.7.1 (build: release, commit: 420be74)
container-apiserver commit: 420be748f18afc685d11987ac5118c928e174c19
sudo lsof -i :53
<still nothing>
ifconfig | grep bridge100
<nothing>
Now starting the build. The Dockerfile has the following lines in it:
FROM internal-FQDN/os/oraclelinux:9-slim as swift-build
COPY --from=another-internal-FQDN/path:1.50 / /
container build --arch amd64 -t test .
=> [resolver] fetching image...
=> [resolver] fetching image...
=> [internal] load .dockerignore => => transferring context: 2B => [internal] load build context => => transferring context: 1.38GB => CACHED .....
=> => resolve internal-FQDN/os/oraclelinux:9-slim@sha256:...
=> ERROR FROM another-internal-FQDN/path
=> => resolve another-internal-FQDN
------
> FROM another-internal-FQDN
------
Error: unknown (2): failed to solve: failed to load cache key: failed to do request: Head "https://another-internal-FQDN/path": dial tcp: lookup another-internal-FQDN on 192.168.64.1:53: read udp 192.168.64.2:49171->192.168.64.1:53: i/o timeout
sudo lsof -i :53
<now something starts showing up>
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mDNSRespo 690 _mdnsresponder 65u IPv4 0xa0333592b0e0ef03 0t0 UDP *:domain
mDNSRespo 690 _mdnsresponder 70u IPv6 0xe5346de6a26dfbe9 0t0 UDP *:domain
mDNSRespo 690 _mdnsresponder 77u IPv4 0xed210cd717006116 0t0 TCP *:domain (LISTEN)
mDNSRespo 690 _mdnsresponder 78u IPv6 0x19ee3aab42d389dc 0t0 TCP *:domain (LISTEN)
ifconfig | grep bridge100 -A 3
<this is new after the build attempt>
bridge100: flags=8a63<UP,BROADCAST,SMART,RUNNING,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether 82:a9:97:d0:2b:64
inet 192.168.64.1 netmask 0xffffff00 broadcast 192.168.64.255
If I just do `container image pull another-internal-FQDN/path', it downloads the image just fine. But when I try to build it again, it doesn't see to use the cached image and fails on the resolver.
Zscaler, dnsmasq, or anything else listening on port 53 creates a situation where the macOS DNS service can't start its listener on that port. Unfortunately, this behavior isn't something we have control over.
I've created apple/containerization#436 for one possible workaround for this issue. Should we do that we can then create an issue here to plumb the feature up into container run.
I'm running into this with Container, but it hasn't been an issue with Podman, Docker Desktop, or Finch. How do the others do it? Binding to a different localhost address (e.g. 127.0.0.11) may be the way.
Hi folks, Running 0.12.3 and DNS is still not working. Any news @jglogan?
I encountered the same issue. I solved it just create a new network.
container system dns create box container system dns default set box container network create box container run .... --network box
Does the fact you're creating another network and specify it --network box means the DNS is not working on default network?
I can reproduce this on container 1.0.0 on macOS 26.5.1, including on a custom network. This came up while testing Compose-compatible workflows via container-compose, but the failure reproduces with plain container commands.
This is currently the biggest blocker for Compose-style local development because Compose service discovery expects service names such as web, db, or configured aliases to resolve between services on the same network. I avoided opening a new issue because this appears to be the same underlying "container names should resolve" problem.
I can confirm that @thromel's issue is present on 1.0.0 and 1.1.0 while 0.12.3 didn't have this issue with the custom network and DNS setup I described earlier. This is really blocking my uprade to any 1.x version :(.
to the ~/.config/container/config.toml makes it all work again (like we did with the dns.domain system property before). appdomain corresponds to an entry created by container system dns create
Reacted by Kathryn Baldauf, Chris Wan and Leonard A. Mazzone
to the ~/.config/container/config.toml makes it all work again (like we did with the dns.domain system property before). appdomain corresponds to an entry created by container system dns create
This seemed to do it for me as well, came here straight from the web server tutorial. Didn't work on the first pass. To be fair, not a clean report because I also tried some of the steps above.
Activity
seven1240 commentedon Nov 7, 2025
Could be alpine related, can you try debian? I have run into this before: #480
skinny commentedon Nov 7, 2025
Yes I also tried debian , same behavior unfortunately. I am looking for a way to debug this further as it remains a mystery why this was working properly last week and as this is such a basic scenario, I must be doing something wrong on my machine
skinny commentedon Nov 9, 2025
After a couple of hours trial and error today the lines above is what makes it work. I must have had that done during my initial testing (before wiping the device). Not sure it's in the docs yet but it definately should be in there as users might expect inter-container dns working out of the box
AT-main commentedon Nov 12, 2025
I ran into the same thing. Setting those properties got the containers talking to each other, but I later had to remove them when building images. With the custom DNS domain set, connections from inside the containers couldn’t reach the outside world.
Clearing those settings fixed it for me:
container system property clear dns.domain sudo container system dns rm mycorp container system stop && container system startFor now, it looks like I need to toggle these settings depending on whether I’m building images or running containers.
naikrovek commentedon Dec 3, 2025
This is bizarre to read, because at my employer I'm trying to do
apt updatefrom within an ubuntu container and the container can't resolve anything no matter what I do, and it doesn't matter if I'm building a container or running one. other tools which use MacOS Linux VMs (outside ofcontainerentirely) can use DNS just fine. it's like the host OS is blocking DNS resolution for things running insidecontainerand nothing else, and I don't understand how that can happen. running version 0.7.0.jglogan commentedon Dec 3, 2025
@naikrovek Could you provide the output of
sudo lsof -i 53?naikrovek commentedon Dec 3, 2025
That answers it for me. Zscaler is bound to that port.
I was running this command because I found #402 and read through it and sure enough, something is using port 53.
Zscaler is ... the worst. It breaks everything.
For those that don't know, Zscaler is a MITM cloud proxy which intercepts every HTTPS request, decrypts it, logs the requests, re-encrypts and passes it on to the server you were trying to reach as an HTTP client. it rewrites requests and responses according to rules and basically usurps TLS and makes the entire TLS superstructure of the web pointless.
naikrovek commentedon Dec 3, 2025
@jglogan I answered above if you didn't already see. I can work around Zscaler with the
--dnsparameter forcontainer runbut that doesn't help one container resolve another. fortunately, I almost never need to do this.Tazintosh commentedon Dec 4, 2025
Hi folks,
Is my issue related?
Issue:
ping containerName.contfrom the host sometimes works, most of the time not.I've tried:
--> This does not necessarily help. Doing so could make some containers to answer ping while other are still not.
jglogan commentedon Dec 5, 2025
@naikrovek Exactly. See also #345 and #817.
Zscaler,
dnsmasq, or anything else listening on port 53 creates a situation where the macOS DNS service can't start its listener on that port. Unfortunately, this behavior isn't something we have control over.I've created apple/containerization#436 for one possible workaround for this issue. Should we do that we can then create an issue here to plumb the feature up into
container run.jglogan commentedon Dec 5, 2025
@Tazintosh Do you see the
contdomain in the output ofscutil --dns?e.g.
You should also see a configuration file on your system for the local domain:
Also, check the output of
sudo lsof -i :53.Tazintosh commentedon Dec 5, 2025
Hi @jglogan
I'm seeing this under "DNS Configuration" (not under "DNS configuration (for scoped queries)"
Then:
Finally:
Ping still not resolving.
jglogan commentedon Dec 6, 2025
How about
sudo lsof -i :2053Tazintosh commentedon Dec 6, 2025
All my container's DNS seems to resolve at the moment… It's good but I've no idea why.
BTW, when I ping each of them one after each other, one did not resolve at first, and when I tried a second time after about a minute, it did…
Anyway, I've the feeling the next time I'll start a container, all of this won't work anymore.
[Edit] I was right (kind of). Less than 10s after successfully testing again pinging my DNS after this post, nothing was resolving anymore. But contrary to my feeling, it was even without a single action from me in between BTW.
skinny commentedon Dec 8, 2025
After a couple of weeks of testing, the DNS behaviour is flaky at best. After a reboot and starting all containers everything works but after "some" time thing just start to break down. Internal DNS resolving from within the containers no longer work.
@jglogan any ideas on what I can do to pinpoint the cause of this?
iliasaz commentedon Jan 8, 2026
I'm having a similar issue when building an image. No 3rd party DNS services involved. Before
container system start, no one is listening on port 53.Starting the container.
Now starting the build. The Dockerfile has the following lines in it:
If I just do `container image pull another-internal-FQDN/path', it downloads the image just fine. But when I try to build it again, it doesn't see to use the cached image and fails on the resolver.
Podman and docker work fine.
bulebuk commentedon Feb 17, 2026
I'm running into this with Container, but it hasn't been an issue with Podman, Docker Desktop, or Finch. How do the others do it? Binding to a different localhost address (e.g. 127.0.0.11) may be the way.
Tazintosh commentedon Apr 9, 2026
Hi, I've just updated from 0.7.1 to 0.11.0 and I still cannot ping my containers using their DNS.
Even from the host computer.
Tazintosh commentedon May 14, 2026
Hi folks,
Running 0.12.3 and DNS is still not working.
Any news @jglogan?
jmpolom commentedon Jun 5, 2026
This...was...working? And now...is not?
SeniorPlayer commentedon Jun 9, 2026
I encountered the same issue. I solved it just create a new network.
container system dns create box
container system dns default set box
container network create box
container run .... --network box
Tazintosh commentedon Jun 10, 2026
Does the fact you're creating another network and specify it
--network boxmeans the DNS is not working on default network?katiewasnothere commentedon Jun 10, 2026
@Tazintosh Could you create a new issue with the details of what you're seeing and what you've tried? This issue is starting to get a bit crowded.
SeniorPlayer commentedon Jun 11, 2026
yes, I think so
thromel commentedon Jun 25, 2026
I can reproduce this on
container1.0.0 on macOS 26.5.1, including on a custom network. This came up while testing Compose-compatible workflows viacontainer-compose, but the failure reproduces with plaincontainercommands.Environment:
Minimal repro:
Observed:
The same container is reachable by IP from another container on the same network:
The container resolver is configured to use the network gateway:
This is currently the biggest blocker for Compose-style local development because Compose service discovery expects service names such as
web,db, or configured aliases to resolve between services on the same network. I avoided opening a new issue because this appears to be the same underlying "container names should resolve" problem.skinny commentedon Jul 12, 2026
I can confirm that @thromel's issue is present on 1.0.0 and 1.1.0 while 0.12.3 didn't have this issue with the custom network and DNS setup I described earlier. This is really blocking my uprade to any 1.x version :(.
I followed the same reproduction path.
feat(setup): add Apple `container` orchestrator for the storage stack
skinny commentedon Jul 14, 2026
Upon further testing I found that adding
to the
~/.config/container/config.tomlmakes it all work again (like we did with the dns.domain system property before).appdomaincorresponds to an entry created bycontainer system dns createlenmazzone commentedon Nov 14, 2026
This seemed to do it for me as well, came here straight from the web server tutorial. Didn't work on the first pass. To be fair, not a clean report because I also tried some of the steps above.