.local domain not working

1. Caddy version (caddy version):

caddy version 2.4.6

a. System environment:

Mac OS Monterey
Firefox Developer Edition

b. Command:

caddy start

c. Service/unit/compose file:

Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.

d. My complete Caddyfile or JSON config:

*.subdomain.local {
        reverse_proxy localhost:3333
}

admin.subdomain.local {
        reverse_proxy localhost:3000
}

3. The problem I’m having:

I have a Caddyfile with the following config with the TLD configured as .local but it isn’t resolving when I open it with the browser or if I try a curl request.

When I change .local to .localhost and then restart Caddy it works. Does anyone know why .local isn’t working? Is it a Mac thing? Or a mis-configuration?

4. Error messages and/or full log output:

5. What I already tried:

6. Links to relevant resources:

I’m not sure how Mac resolves .local. Local might mean on the LAN to MacOS, not localhost, hence the two different TLDs. You might have to set up a DNS resolver to ensure that your .local domain resolves to the IP you expect.

1 Like

.local is usually take up by Apple devices for multicast DNS. It’s not recommended to use .local for web servers.

Instead, you should use .localhost if this is just something you’re reaching from the same machine, or .home.arpa if you need it to work in your LAN.

.home.arpa won’t automatically resolve though, you’ll need to run a DNS server in your network that would resolve it and forward any other DNS queries to some publicly authoritative DNS server.

2 Likes

Thanks, we decided to use .localhost instead and we are up and running :slight_smile:

This topic was automatically closed after 30 days. New replies are no longer allowed.