Dynamic dns and A records

I would like to host a webserver on my Synology NAS but I do not have a fixed IP address. I do have a ddns.hostname.com Dynamic DNS running on the Synology. I am able to use that hostname for subdomains like server.hostname.com but using Googles Domains I do not know how to get the hostname.com domain to point to the Synology at ddns.hostname.com. I do not think domain forwarding is the right way but not sure? Any help would be appreciated.

BTW: I worry about Squarespace buying Google Domains, I hope they do not screw it up.

I am guessing your point to www record to ddns.hostname.com

You need to use CNAME’s and point that record to you main domain “hostname.com

Example:

Site1.hostname.com —> hostname.com
Site2.hostname.com —> hostname.com

In this way when your ip changes for hostname.com so will all of your CNAME records (aliases).

1 Like

You can not make a cname record for a hostname.com only for subs.

I want hostname.com to point to ddns.hostname.com

You can make w, ww, www.hostname.com point to ddns.hostname.com but that is not what I am looking for.

I’m not saying hostname.com needs to be a CNME. I mean hostname.com needs to be an A and your subdomains need to be CNAMES. What provider are you going through? I use cloudflare and I use my pfsense to update my DDNS.

You are right, you cannot create CNAME entries for the root domain. But Cloudflare, for example, uses CNAME flattening, which lets you pretend you made a CNAME record for the root while actually returning the correct A and AAAA records when queried.

Domain names are part of the DNS system which can be thought of as who holds the authoritative domain records for a particular domain name - it’s all about records. Browsers use URLs to navigate. You need to accomplish two tasks:

  1. Setup a 301 redirect from current URL e.g. https://my.domain.com in your domain management services portal to your dynamically assigned URL e.g. https://ddns.hostname.com (note: you can use paths and URL parameters if you wish).
  2. Setup port forwarding on your publicly facing router to open a route between the Internet and your NAS device e.g. WAN Router IP Port 80 & 443 to LAN NAS IP Port 80 & 443.

Note: I am assuming that your NAS is behind your LAN’s firewall and you’re using NAT internally e.g. external = x.x.x.x, internal = 192.168.x.x.

You can check whether the redirect is functioning by entering your my.domain.com into tools such as domaindiagnostics.com.

Exposing your NAS (or any device on your LAN) to the Internet is not recommended. You can make it a bit harder for hackers by only allowing HTTPS traffic through and port forwarding from an unusual port e.g. 54321 > 443. A far better solution would be host your website on the Internet somewhere.