Local hostnames
For local development you do not need public DNS or certificates. The all-in-one compose stack includes a small DNS sidecar, worker-dns, and a helper script that points your operating system at it.
How it works
Section titled “How it works”worker-dnsis a zone-scoped CoreDNS container listening on127.0.0.1:15353(UDP and TCP). Change the port withWORKERS_DNS_PORT.- It answers
*.<zone>with127.0.0.1. The zone isWORKERS_DOMAIN, defaultworkers.local. It is not a general resolver. - Worker traffic enters the stack on
127.0.0.1:8080(VRT_PORT). The console is on127.0.0.1:8788and the plane on127.0.0.1:8787. - Do not use port 5353; macOS mDNSResponder owns it and the script refuses it.
Install the resolver
Section titled “Install the resolver”Start the stack first, then run from the repository root:
node scripts/all-in-one-local-dns.mjs --domain workers.local --port 15353The script reads its defaults from the WORKERS_DOMAIN and WORKERS_DNS_PORT environment variables, not from .env, so pass the flags explicitly if you changed them. The domain must contain a dot and match ^[a-z0-9]([a-z0-9.-]*[a-z0-9])?$. The port must be 1 to 65535.
| OS | What the script does |
|---|---|
| macOS | With sudo, writes /etc/resolver/<domain> containing nameserver 127.0.0.1 and port <port>, then self-verifies with dscacheutil. |
| Linux | Prints a systemd-resolved drop-in (/etc/systemd/resolved.conf.d/workers-local.conf with DNS=127.0.0.1:<port> and Domains=~<domain>) and the command sudo systemctl restart systemd-resolved. |
| Other | Prints a manual instruction. |
Verify
Section titled “Verify”dscacheutil -q host -a name probe.workers.local # macOS, expect 127.0.0.1dig @127.0.0.1 -p 15353 probe.workers.local +short # any OS, expect 127.0.0.1Then open a worker at http://<worker>.workers.local:8080/. Without the resolver you can still reach it by sending the Host header:
curl -H 'Host: hello.workers.local' http://127.0.0.1:8080/Change the zone
Section titled “Change the zone”- Set
WORKERS_DOMAIN,WORKERS_DNS_PORTandVRT_PORTin.env. - Recreate the stack:
docker compose -f docker-compose.all-in-one.yml up -d. - Re-run the script, for example
node scripts/all-in-one-local-dns.mjs --domain workers.test --port 15353.
WORKERS_DOMAIN also becomes the default worker domain, so new workers are named <name>.<WORKERS_DOMAIN>. Existing hostnames are not rewritten.
Disable
Section titled “Disable”On macOS:
sudo rm /etc/resolver/workers.localsudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderOn Linux, remove the drop-in and restart systemd-resolved.
Caveats
Section titled “Caveats”- Local hostnames are plain HTTP on
VRT_PORT; there is no TLS. - In TLS installs the installer sets
WORKERS_DOMAINto your worker base domain, so do not mix this guide with a public install. - Use
.testorworkers.local-style names that you do not own publicly.
See also Services and ports and Configuration.