I have 2 servers:
Server1: doamin.app, www.domain.app on docker,portainer, NPM connecting to cloudflare via oznu container.
Server2: m.domain.app, apache2, dns-cloudflare-api.
To create a new subdomain, I had to deploy a new onzu stack, since it doesn’t let me create as many subdomains as I need in one yml file.
version: '2'
services:
cloudflare-ddns:
image: oznu/cloudflare-ddns:latest
restart: always
environment:
- API_KEY=myAPI_key
- ZONE=domain.app
- SUBDOMAIN=m
- PROXIED=true
- e CRON=*/5 * * * *
On Cloudflare:
If I set:
A > domain.app > public IP1
A > domain.app > public IP2
without CNAME for m.domain.app, I get 523 error on server2, domain.app
This is what oznu does: overrides IP2, so origin is not reached.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 30-cloudflare-setup: executing...
DNS Zone: m.domain.app (2bxxxxxx9026363b71a762)
DNS Record: m.domain.app (xxxxxxxe381939a96f89ae)
[cont-init.d] 30-cloudflare-setup: exited 0.
[cont-init.d] 50-ddns: executing...
Updating CloudFlare DNS record m.domain.app from 129.www.www.37 to 150.www.www.9...
CloudFlare DNS record m.domain.app (150.www.www.9) updated successfully.
[cont-init.d] 50-ddns: exited 0.
[cont-init.d] done.
[services.d] starting services
Starting crond...
crond: crond (busybox 1.31.1) started, log level 6
[services.d] done.
crond: USER root pid 246 cmd /etc/cont-init.d/50-ddns
No DNS update required for m.domain.app (150.www.www.9).
crond: USER root pid 261 cmd /etc/cont-init.d/50-ddns
Updating CloudFlare DNS record m.domain.app from 129.www.www.37 to 150.www.www.9...
CloudFlare DNS record m.domain.app (150.www.www.9) updated successfully.
crond: USER root pid 281 cmd /etc/cont-init.d/50-ddns
No DNS update required for m.domain.app (150.www.www.9).
crond: USER root pid 296 cmd /etc/cont-init.d/50-ddns
No DNS update required for m.domain.app (150.www.www.9).
If I set Cloudflare to a CNAME and point A record the same way, Oznu returns:
Updating CloudFlare DNS record m.domain.app from null to 150.www.www.9...
ERROR: Failed to update CloudFlare DNS record m.domain.app from null to 150.www.www.9
And server 2 returns error 504.
I have Nginx setting for the subdomain:
m.domain.app > IP2 > port 80 > lets encrypt > online.
I didn’t understand the other post different domain name explanation on how to declare and external IP.
Could you give me an example please?