My curent Network:
Router - 192.168.1.1 (static)
Windows PC - 192.168.1.10 (static)
Synology NAS - 192.168.1.11 (static)
DockerPihole - 192.168.1.12 (macvlan-static)
DockerUnbound - 192.168.1.13 (macvlan-static)
DockerTraefik - 192.168.1.14 (macvlan-static)
Docker Bridge Network (For Traefik to work)
DockerTraefik - 192.168.10.2 (bridge-static)
DockerNginx1 - 192.168.10.10 (bridge-static)
DockerNginx2 - 192.168.10.20 (bridge-static)
- I'm running Docker on my Synology NAS
- I'm running DNS on my Synology NAS (the builtin DNS app)
Pi-Hole, Unbound, and Traefik are running in a shared macvlan.
- I created a bridge network for Traefik to connect to each container.
- I'm configuring Labels on each container's stack in portainer to handle the Traefik configuration.
- I'm trying to follow the tutorial here https://youtu.be/wLrmmh1eI94 but this was not on a synology so it's slightly different.
- Although I do own the domain I'm trying to use, my understanding is that it shouldn't be necessary as long as I can point to my Synology DNS server which handles that domain.
The main differnece is that the Synology is already using 80 and 443 so my solution was to put Traefik in a macvlan so I didn't have port conflicts.
I got most everything working but I'm having trouble figuring out this one (hopefully last) thing. In the Traefik logs I can see that letsencrypt.org is having problems with my DNS.
Here's the error for the log:
level=error
msg=Unable to obtain ACME certificate for domains "nginx2.mydomain.com":
unable to generate a certificate for the domains [nginx2.mydomain.com]:
error: one or more domains had a problem:
[nginx2.mydomain.com] acme: error: 400 :: urn:ietf:params:acme:error:dns :: DNS problem: NXDOMAIN looking up A for nginx2.mydomain.com
- check that a DNS record exists for this domain; DNS problem: NXDOMAIN looking up AAAA for nginx2.mydomain.com
- check that a DNS record exists for this domain
providerName=staging.acme
routerName=nginx2@docker
rule=Host(`nginx2.mydomain.com`)
ACME CA=https://acme-staging-v02.api.letsencrypt.org/directory
I've setup the DNS in the Synology and have my router set to have the Synology as my first DNS server.
When I ping nginx2.mydomain.com from my PC and it returns the IP of the DockerTraefik container 192.168.1.14. I believe this is the correct behavior.
Also when I look in my acme.json file (which was empty) I see that it has been populated with a certificate that says "status": "valid" (staging for now, production is empty). I believe this is the correct behavior.
I'm not sure what I'm missing but when I browse to nginx2.mydomain.com the certificate in the browser says
Issued to: TRAEFIK DEFAULT CERT
Issued by: TRAEFIK DEFAULT CERT
I'm expecting it to say:
Issued to: nginx2.mydomain.com
Issued by: (STAGING)...
Here are my goals:
- (done) Access my Docker containers by name. ex: nginx.mydomain.com
- (done) Access my Docker containers without DNS (in case of issues). ex: 192.168.1.14:10080
- Browser says "secure" when I access my containers by name.
- I may want to expose one or two of them externally later so keeping that option easily available is key but ATM I plan to use a VPN for everything.
Problems I've solved so far:
- I can't give Traefik direct access to 80/443 because the NAS is using those ports.
- I put Traefik in a macvlan network
- Containers couldn't ping their parent
- By adding ports to the stack(ex: "Ports:/n - 180:80/n - 1443") it allowed me to access the container directly with DNS (goal #2) and also fixed the ping issue to the parent.