Allow Docker container DNS through UFW for the 192.168 address pool
Checked on this Omarchy 4 workstation (omarchy 4.0.2-1, omarchy-settings 4.0.2-1, ufw 0.36.2-7, docker 1:29.7.2-1) and against the cited issue and the Docker docs. The mechanism holds: docs.docker.com/engine/network confirms the built-in default pools verbatim, six inside 172.16.0.0/12 and then { "base": "192.168.0.0/16", "size": 20 }, and 15 networks come out of the 172 pools before Docker reaches the 192.168 one. The scope is wrong. Confirmed on this machine that /usr/share/omarchy/install/config/firewall.sh already carries the 192.168.0.0/16 rule alongside the 172.16.0.0/12 one, and /etc/ufw/user.rules shows both applied as tuples with the allow-docker-dns comment, so the record's cause sentence saying Omarchy allows Docker DNS "only from 172.16.0.0/12" is false on any install made after upstream closed issue 5464 as completed on 2026-04-29. The rule is still on tag v4.0.3. A reader on a current machine is told to add a rule that already exists, which ufw declines as a duplicate, and learns something untrue about their own system. The record is still true for Omarchy machines installed before that fix, because firewall.sh runs at install time and nothing re-runs it: I grepped all 96 scripts in /usr/share/omarchy/migrations and the only one mentioning ufw is 1788025225.sh, which removes retired installer sudoers files and adds no firewall rule. It is also still true on plain Arch and the derivatives, which ship neither rule. Rewrote the cause to say all of that rather than rejecting the record.
On the daemon.json question I was asked to check: this record does not tell the reader to paste a whole daemon.json, so it does not delete anything. The keys it relies on are intact and consistent. pacman -Qo /etc/docker/daemon.json reports omarchy-settings 4.0.2-1, the file carries "dns": ["172.17.0.1"] and "bip": "172.17.0.1/16", ip -4 addr show docker0 shows 172.17.0.1/16 live, and firewall.sh opens port 53 on exactly that address. I found a third shipped piece the record never mentioned and added it, because without it the DNS server the containers are pointed at would not answer: /etc/systemd/resolved.conf.d/20-docker-dns.conf, also owned by omarchy-settings and also a pacman backup file, sets DNSStubListenerExtra=172.17.0.1. That is worth having in the cause, since a reader who deletes that drop-in or changes bip gets the same symptom for a different reason. I cross-referenced the danger with the docker-gpu-could-not-select-device-driver finding and confirmed /etc/docker/daemon.json is in the omarchy-settings backup array and currently unmodified, so the .pacnew claim in that record is correct and I repeated it here.
Three smaller defects. The fix calls docker network inspect bare and the verify calls docker run bare, but Omarchy deliberately leaves the user out of the docker group: confirmed with id -nG, which shows no docker, and docker network ls here fails with permission denied while trying to connect to the docker API at unix:///var/run/docker.sock. Both now use sudo. The verify asked for "a non-zero packet count" from sudo ufw status, which never prints counters at all, so that check could not pass however healthy the machine, and it now points at iptables -L ufw-user-input -n -v instead. The danger clause was directionally right and imprecise: the rule is scoped to destination 172.17.0.1, so a LAN host in 192.168.0.0/16 is not automatically able to reach it, but the thing behind it is a recursive resolver and anything that can route to 172.17.0.1 gets an open resolver, which is the sharper statement. I also added the alternative that avoids the firewall change entirely, a default-address-pools entry keeping automatic subnets inside 172.16.0.0/12, and flagged that restarting dockerd stops running containers. 172.18.0.0/15 at size 24 is arithmetic from the documented pool format and does not overlap docker0's bip, but I could not run it. Severity medium and frequency occasional both stand: the consequence is failed name resolution in one container and nothing is damaged, and although the condition is now unreachable on a fresh Omarchy 4 install it remains genuine on older installs and on the three other targets the record claims.
Sources: the only cited URL, https://github.com/basecamp/omarchy/issues/5464, is a hard 404 even after following redirects, so it is removed and replaced with the omacom/omarchy URL, which returns 200. I read the issue in full with gh issue view 5464 -R omacom/omarchy: it has no comments, was filed against Omarchy 2.x on 2026-04-27 and closed as completed two days later, and it does support the mechanism the record describes, including the observed curl: (6) Could not resolve host line and the workaround rule.
Not exercised, and I did not use sudo on this workstation by instruction: I ran no docker command, so I never created a network in the 192.168 pool, never reproduced the resolution failure, and never confirmed the fix end to end. I ran no ufw command either, so the applied rules come from reading /etc/ufw/user.rules rather than from live ufw status output, and the exact ufw status formatting quoted in the fix is the documented two-line shape rather than a transcript from this machine. I did not restart dockerd or test the default-address-pools alternative.
The rule allows any source in 192.168.0.0/16 to reach port 53 on 172.17.0.1, and on Omarchy that address is a real recursive resolver, systemd-resolved's extra stub listener from /etc/systemd/resolved.conf.d/20-docker-dns.conf. A host on your LAN cannot reach it by accident, because a packet has to be addressed to 172.17.0.1 and routed to this machine, but anything on the same link that can add a route can use it as an open resolver. Narrow the source to the exact Docker subnet, or avoid the rule altogether with the default-address-pools change above.
Editing /etc/docker/daemon.json carries its own risk on Omarchy 4. It is a pacman backup file owned by omarchy-settings, so a hand-edited copy produces a .pacnew during omarchy update that has to be merged rather than ignored, and dropping the shipped dns and bip keys breaks DNS in every container. Whatever you change, the file must stay valid JSON. A stray trailing comma makes docker.service fail to start and takes every container down with it, so run python3 -m json.tool /etc/docker/daemon.json before restarting the daemon.
Symptom
DNS works on the host and inside most containers, but fails inside one particular devcontainer / user-defined bridge network:
curl: (6) Could not resolve host: registry.npmjs.org
Containers on 172.x networks are fine. The broken one is on something like 192.168.0.0/20.
Cause
Docker's built-in default-address-pools are documented as six pools inside 172.16.0.0/12 followed by { "base": "192.168.0.0/16", "size": 20 }. The three /16 pools and three /14 pools at size 16 supply 15 networks in total, so once those are taken the next bridge network Docker creates automatically comes out of 192.168.0.0/20. Containers there still resolve through the embedded resolver at 127.0.0.11, which forwards to whatever DNS server the daemon was given, and on Omarchy that is 172.17.0.1, the docker0 gateway.
Three shipped pieces have to line up for that address to answer. /etc/docker/daemon.json, owned by omarchy-settings, sets "dns": ["172.17.0.1"] and "bip": "172.17.0.1/16". /etc/systemd/resolved.conf.d/20-docker-dns.conf, same package, sets DNSStubListenerExtra=172.17.0.1 so systemd-resolved actually listens on that address. /usr/share/omarchy/install/config/firewall.sh then opens port 53 on it to the container subnets.
**On a current Omarchy 4 install this is already fixed and the record does not apply.** firewall.sh opens both pools:
ufw allow in proto udp from 172.16.0.0/12 to 172.17.0.1 port 53 comment 'allow-docker-dns'
ufw allow in proto udp from 192.168.0.0/16 to 172.17.0.1 port 53 comment 'allow-docker-dns'
The second line landed when upstream issue 5464 was closed as completed on 2026-04-29, and it is still there on tag v4.0.3. firewall.sh runs at install time only and no Omarchy migration adds the rule afterwards, so a machine installed from an ISO older than that and upgraded in place still carries only the 172.16.0.0/12 rule and still fails. Plain Arch, EndeavourOS and CachyOS have neither rule and hit this as soon as a container on a 192.168 network needs the host as its DNS server. Check what is on the machine before adding anything.
Fix
Check what is already there first. On a current Omarchy 4 install both rules ship and ufw answers Skipping adding existing rule rather than changing anything:
sudo ufw status | grep -i docker-dns
Expected on a current install:
172.17.0.1 53/udp ALLOW 172.16.0.0/12 # allow-docker-dns
172.17.0.1 53/udp ALLOW 192.168.0.0/16 # allow-docker-dns
Then confirm the broken network really is outside 172.16.0.0/12, and that the daemon is pointing containers at the docker0 gateway. Omarchy leaves your user out of the docker group unless you opted in through Setup > Security > Sudoless Docker, so the client needs sudo or it fails with permission denied while trying to connect to the docker API at unix:///var/run/docker.sock:
sudo docker network inspect <network> --format '{{ (index .IPAM.Config 0).Subnet }}'
cat /etc/docker/daemon.json
ip -4 addr show docker0
If the rule really is missing, add it. It takes effect immediately, with no reload:
sudo ufw allow in proto udp from 192.168.0.0/16 to 172.17.0.1 port 53 comment 'allow-docker-dns'
Add TCP only if something needs the DNS-over-TCP fallback:
sudo ufw allow in proto tcp from 192.168.0.0/16 to 172.17.0.1 port 53 comment 'allow-docker-dns-tcp'
**The narrower fix is to keep Docker out of the 192.168 pool instead of widening the firewall.** Set default-address-pools so every automatically allocated subnet stays inside 172.16.0.0/12, which the stock rule already covers. 172.18.0.0/15 gives 512 networks at size 24 and does not collide with the 172.17.0.0/16 that bip pins to docker0:
{
"log-driver": "json-file",
"log-opts": { "max-size": "10m", "max-file": "5" },
"dns": ["172.17.0.1"],
"bip": "172.17.0.1/16",
"default-address-pools": [
{ "base": "172.18.0.0/15", "size": 24 }
]
}
python3 -m json.tool /etc/docker/daemon.json
sudo systemctl restart docker.service
Restarting the daemon stops every running container. Existing networks keep the subnets they were created with, so delete and recreate the broken one afterwards.
**Do not paste a whole-file daemon.json from a blog over the top on Omarchy 4.** The file is owned by omarchy-settings and the dns and bip keys above are what make container DNS work at all, because the firewall permits port 53 only to 172.17.0.1. Add keys and keep the rest:
pacman -Qo /etc/docker/daemon.json # omarchy-settings
On plain Arch, EndeavourOS or CachyOS the file usually does not exist and none of this applies, so set dns yourself or leave the daemon on the host's resolvers.
Verify
sudo docker run --rm --network <network> alpine nslookup registry.npmjs.org
resolves, and sudo ufw status lists the 192.168.0.0/16 line to 172.17.0.1 port 53. Do not expect a packet count there, because ufw status never prints counters. If you want to see the rule matching, sudo iptables -L ufw-user-input -n -v shows packets against it. Before concluding the firewall was the problem, confirm the rule was absent to begin with: on a current Omarchy 4 install sudo ufw status | grep -i docker-dns already prints two lines, and ufw refuses the duplicate with Skipping adding existing rule.