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?
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.
.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.