Dynamic DNS from two different locations? reddit / selfhosted ---------------------------------------------------------------------- nightmareFluffy · 2023-11-04 22:04 I have a website (let's say example.com) where I have subdomains, like video.example.com and files.example.com, coming from two different locations. One from work, one from home. How do I set up dynamic DNS from two locations pointing to one domain? I looked into Cloudflare Dynamic DNS, but it has a line in the compose file where it asks about domain, and I don't want it to hijack all the subdomains to that IP address. I'm currently using a different A record for each subdomain. One thing I thought about was using Tailscale somehow to solve this. But I wouldn't even know where to start. I'm not sure if any of this matters, but for the sake of completeness: -Both IP addresses are using Nginx to send traffic to example.com -One of the IP addresses is also using Cloudflare tunnels for some of the subdomains. I'm not worried about those; they never break when the public IP address changes. -One of the IP addresses (home) is mostly for playing around and trying new things. But it does have one important thing on it (home security cameras), so I don't want to break it if I don't have to. -I prefer to use the [Cloudflare DDNS](https://hub.docker.com/r/oznu/cloudflare-ddns/) so everything is with one provider, and there are fewer points of failure. The domain is registered with Cloudflare. But I'll try other stuff if there's no way to do it. ---------------------------------------------------------------------- tech2but1 · 2023-11-04 22:22 I think you have "from" and "to" mixed up here somewhere so I got lost in your issue. Assuming you just want video.example.com to go to home and files.example.com to go to work then just set a CNAME on video.example.com to the DDNS address for the home service and the CNAME on files.example.com to the DDNS address of the work service. ---------------------------------------------------------------------- nightmareFluffy · 2023-11-04 22:34 Apologize, I think I have "to" and "from" mixed up myself. I think of the services coming "from" either work or home and going "to" the domain. I might have that backwards. Anyway, I'll give that a shot. I thought CNAMEs were always something like @, but maybe it's a weird code I need to put in. I'll have to experiment. I'm kind of new to CNAMEs. Thanks for the advice! ---------------------------------------------------------------------- tech2but1 · 2023-11-04 22:38 A CNAME is just a "forward to" entry. So a CNAME of ```my-home.no- ip.com``` on ```files.example.com``` would just tell anyone visting ```files.example.com``` to go to ```my-home.no-ip.com```. Kind of like a standard A record but giving the requester a domain name instead of an IP. No funky symbols needed! ---------------------------------------------------------------------- JuvenoiaAgent · 2023-11-04 22:58 Better version of Cloudflare DDNS: https://hotio.dev/containers/cloudflareddns/ You can update multiple entries (subdomains in your case). Run an instance of it on each server and update its relevant subdomains. ---------------------------------------------------------------------- clintkev251 · 2023-11-04 23:05 @ generally represents the zone apex, so if your zone was domain.com, using @ would mean just domain.com. If you use a value like foo, the cname would be for foo.domain.com. Funnily enough, @ actually isn’t technically allowed for cnames, but a lot of DNS providers fake it by tuning those into A records instead ---------------------------------------------------------------------- nightmareFluffy · 2023-11-04 23:24 This looks awesome, and it might solve my problem! Thanks for sending! Great community here. ---------------------------------------------------------------------- nightmareFluffy · 2023-11-05 00:30 Huh, never knew that. Interesting tidbit about the @. ---------------------------------------------------------------------- nightmareFluffy · 2023-11-06 14:02 Great explanation!