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]: Wrong DNS resolver filename theory — not a bug, closed #1407
container system dns create vm creates the resolver file as /etc/resolver/containerization.vm instead of /etc/resolver/vm:
$ ls /etc/resolver/
containerization.vm
$ cat /etc/resolver/containerization.vm
domain vm
search vm
nameserver 127.0.0.1
port 2053
macOS dispatches DNS queries based on the resolver filename (resolver(5)), not the domain directive inside the file. A query for nginx.vm matches /etc/resolver/vm — which doesn't exist. The containerization.vm file only catches *.containerization.vm queries.
The container's embedded DNS server works correctly when queried directly:
$ dig @127.0.0.1 -p 2053 nginx.vm
;; ANSWER SECTION:
nginx.vm. 5 IN A 10.0.4.22
The expected behavior is that container system dns create vm creates /etc/resolver/vm, so <name>.vm resolves from the host — matching what docs/tutorial.md describes.
If the containerization. prefix is intentional namespacing, the docs should reflect the actual hostname format, or the CLI should also create /etc/resolver/<domain>.
macOS dispatches DNS queries based on the resolver filename (resolver(5)), not the domain directive inside the file. A query for nginx.vm matches /etc/resolver/vm — which doesn't exist. The containerization.vm file only catches *.containerization.vm queries.
If you create the vm domain and don't do your workaround, what do you see for scutil --dns for the scoped domain?
I see:
% container system dns ls
DOMAIN
test
% cat /etc/resolver/containerization.test
domain test
search test
nameserver 127.0.0.1
port 2053
% scutil --dns | grep -B 1 -A 5 'domain *: *test'
resolver #11
domain : test
search domain[0] : test
nameserver[0] : 127.0.0.1
port : 2053
flags : Request A records, Request AAAA records
reach : 0x00030002 (Reachable,Local Address,Directly Reachable Address)
This contradicts your assertion that "macOS dispatches DNS queries based on the resolver filename (resolver(5)), not the domain directive inside the file."
The fact that yours is the first complaint to this effect after almost a year is another data point.
Could you show me the part of the man 5 resolver output that states that the filename has a semantic purpose? All I can find in my version of macOS is:
The configuration for a particular client may be read from a file having the format described in this man page. These are at present located by the system in the /etc/resolv.conf file and in the files found in the /etc/resolver directory.
However, client configurations are not limited to file storage. The implementation of the DNS multi-client search strategy may also locate client configuratins in other data sources, such as the System Configuration Database. Users of the DNS
system should make no assumptions about the source of the configuration data.
@jglogan You were right. I re-read man 5 resolver in full — the domain directive inside the file takes absolute priority over the filename.
The root cause on my end was a stale manual edit to /etc/resolver/containerization.vm I'd made almost a year ago while trying to get container's DNS working alongside a local resolver — the same conflict described in #402 — and I completely overlooked it. When my tests started succeeding after I copied the file, I attributed the fix to the rename — but the real fix was a container system dns delete vm && container system dns create vm I'd run a couple of steps earlier, which had already replaced the stale file with a fresh one.
changed the title [-][Bug]: DNS resolver file created with wrong filename, host resolution fails[/-][+][Bug]: Wrong DNS resolver filename theory — not a bug, closed[/+]on Apr 9, 2026
Activity
vxnkjyffmq-code commentedon Apr 9, 2026
Yes thank you
jglogan commentedon Apr 9, 2026
@x8x
If you create the
vmdomain and don't do your workaround, what do you see forscutil --dnsfor the scoped domain?I see:
This contradicts your assertion that "macOS dispatches DNS queries based on the resolver filename (resolver(5)), not the domain directive inside the file."
The fact that yours is the first complaint to this effect after almost a year is another data point.
Could you show me the part of the
man 5 resolveroutput that states that the filename has a semantic purpose? All I can find in my version of macOS is:x8x commentedon Apr 9, 2026
@jglogan You were right. I re-read
man 5 resolverin full — thedomaindirective inside the file takes absolute priority over the filename.The root cause on my end was a stale manual edit to
/etc/resolver/containerization.vmI'd made almost a year ago while trying to get container's DNS working alongside a local resolver — the same conflict described in #402 — and I completely overlooked it. When my tests started succeeding after I copied the file, I attributed the fix to the rename — but the real fix was acontainer system dns delete vm && container system dns create vmI'd run a couple of steps earlier, which had already replaced the stale file with a fresh one.Apologies for the noise. Closing.
[-][Bug]: DNS resolver file created with wrong filename, host resolution fails[/-][+][Bug]: Wrong DNS resolver filename theory — not a bug, closed[/+]Correct the DNS note after re-testing on macOS 27 beta 7 (#15)