Problem to get started and to understand the issue I'm having with subdomains and DNS

1. The problem I’m having:

I don’t know what I’m doing. I have a huge problem to get Caddy working. I want to use a subdomain of my DynDNS address to access a podman container. The container itself is running fine and I can access it from the local network without a problem. But Caddy fails. I can’t even see the sub domain.

I think I fail at DNS and the DNS-01 challenge and how to set it all up. Even though 80 and 443 are forwarded to the correct machine and my domain has the correct IP addresses.

I tried to read tutorials but I’m now at point where all text feel the same.

So my questions are:

  1. How do I get my system running, so that the subdomains are working?
  2. What else do I need to get this running and how do I set up?
  3. Do I need to move my DNS for my domain/host to another provider to make this work? (Currently I use dynv6 and I need IPv6 to work)

2. Error messages and/or full log output:

Sep 12 17:26:02 random caddy[554]: {"level":"error","ts":1789226762.9128492,"logger":"http.acme_client","msg":"challenge failed","identifier":"music.random.teha.be","challenge_type":"tls-alpn-01","problem":{"type":"urn:ietf:params:acme:error:dns","title":"","detail":"no valid A records found for music.random.teha.be; no valid AAAA records found for music.random.teha.be","instance":"","subproblems":null}}
Sep 12 17:26:02 random caddy[554]: {"level":"error","ts":1789226762.9129524,"logger":"http.acme_client","msg":"validating authorization","identifier":"music.random.teha.be","problem":{"type":"urn:ietf:params:acme:error:dns","title":"","detail":"no valid A records found for music.random.teha.be; no valid AAAA records found for music.random.teha.be","instance":"","subproblems":null},"order":"https://acme-v02.api.letsencrypt.org/acme/order/3739970206/556525800476","attempt":1,"max_attempts":3}

3. Caddy version:

2.11.4

4. How I installed and ran Caddy:

pacman and AUR, rand with systemd, currently build and installed with layer4 plugin

a. System environment:

Arch Linux, systemd, Caddy runs directly on the system.

b. Command:

sudo systemctl start caddy.service (did not change any of those.)

c. Service/unit/compose file:

N/A

d. My complete Caddy config:

music.random.teha.be {
  reverse_proxy * localhost:4533 {
    header_up Host {http.reverse_proxy.upstream.hostport}
    header_up X-Forwarded-For {http.request.remote}
    header_up X-Real-IP {http.reverse_proxy.upstream.port}
  }
}

5. Links to relevant resources:

Type here

DDNS providers give you one exact domain (e.g. random.teha.be) and let you update its A/AAAA records via Dynamic DNS. They don’t give you a wildcard domain (*.random.teha.be) for subdomains of your domain (at least I never heard of a DDNS provider offering this). You must use a “real” domain for that.

You can somewhat work around this by also registering music.random.teha.be, though be advised that you need to update both random.teha.be and music.random.teha.be then.

Be advised that both headers are populated automatically by Caddy. The only one you must set is X-Real-IP.

Thanks, for some reason I thought what I wanted to do is possible. Also thank you for the hint with the not needed config line. I think I read that in the logs but I was only looking too much for errors.