Hostnames & Routing
Every project is reached by hostname, not by port. This page explains how those hostnames come to be and how to manage them.
How a hostname is formed
Section titled “How a hostname is formed”By default a project’s hostname is <name>.<base-domain> — for example, project
aurora with base domain coding9.test is served at
https://aurora.coding9.test.
The routing chain is:
dnsmasqanswers*.<base-domain>with127.0.0.1.- The macOS resolver at
/etc/resolver/<base-domain>forwards the domain todnsmasq. - Traefik (owning ports 80/443) matches the
Host()rule in the project’s override and forwards to the right container. - The mkcert wildcard certificate makes the connection trusted.
Manage hostnames with host
Section titled “Manage hostnames with host”A project can serve several hostnames. Manage them with mdocker host:
mdocker host ls aurora # list current hostnamesmdocker host add aurora admin.aurora.coding9.testmdocker host rm aurora admin.aurora.coding9.testAdding or removing a hostname updates the registry and re-renders the override. It
may also regenerate the certificate (to add a new SAN) and restart the router
container so Traefik picks up the change. Pass --no-apply to change the registry
without re-rendering immediately.
Wildcard hostnames
Section titled “Wildcard hostnames”Wildcard hostnames like *.acme.coding9.test are supported. They are rendered as a
Traefik HostRegexp rule that matches exactly one label, and each wildcard must be
added to the certificate as its own SAN. Wildcards are matched for routing but a
concrete host is used wherever a real URL is needed (for example APP_URL).
Open hostnames in the browser
Section titled “Open hostnames in the browser”mdocker open aurora # first hostnamemdocker open aurora admin.aurora.coding9.test # a specific hostnamemdocker open aurora --all # every hostname of the projectRelated
Section titled “Related”- CLI:
open&host - Multiple Base Domains
- Concept: The Edge Stack
Cookie settings
We only use statistics tools if you allow it. Necessary storage keeps this site working; everything else is off until you decide.
Stores your choice from this dialog in your browser (localStorage). No cookie, no transfer to third parties.
Google Analytics 4 via Google Tag Manager, to measure how the site is used. Loaded only after you allow it.