Ddns: two sites, one domain

(It seems the forum system does not like posts with too many "links." Thus I replaced the '.' character with '-' in the names referenced below.)

I have two sites, call them site1-example-com and site2-example-com. I manage the DNS records for both sites using DDNS, specifically noip.com's service. The OpenWrt router at each site uses the ddns service to register names at the site.

What I have found as that configuring ddns to update site1-example-com also causes the service to update example-com. What this means is that both sites compete by updating example-com with their public IP address. Thus example-com appears to point to Site 1, then Site 2, then Site 1, and so on.

What I would prefer is that Site 1 update example-com (there is a CNAME that points www-example-com to example-com) and that Site 2 updates backup-example-com.

The documentation mentions a number of relevant configuration points, such as "domain", "lookup_host", "interface", and so on. However, I cannot find a combination that does what I want.

Is this the expected behavior? Is it possible that there is a bug in ddns-scripts or ddns-scripts_no-ip_com? Does an example configuration for this use case exist?

[Note: I replaced "register" with "update" above. I think the use of "register" might have caused some confusion.]

I haven't used noip, but I think you want to handle this in 2 steps:

  1. Using the domain manager for your noip account/domain name, add an "A" record to the domain (EDIT: Add 2 "A" records -- one for site1 and the other for site2). So you'll have the site1.yourdomain.com and site2.yourdomain.com as separate entries.

In my case (ChangeIP with a subdomain under their freeddns.com domain), I see default values of @, ftp, and www -- this means that if I type www.mydomain.freeddns.com, it can resolve to a different address than typing ftp.mydomain.freeddns.com. These will also be able to resolve to a different address than simply mydomain.freeddns.com or any unspecified wildcard (wildcard.mydomain.freeddns.com) which all resolve under the @ entry.

  1. update the ddns scripts to specify the site1.yourdomain.com at site 1 and obviously site2.yourdomain.com for your other site.

I think what you describe is similar to what I did. However, it seems that instructing ddns to update site1.example.com causes it to also update example.com.

Out of interest, if you perform the update manually using

https://[[USERNAME]]:[[PASSWORD]]@dynupdate.no-ip.com/nic/update?hostname=[[DOMAIN]]&myip=[[IP]]

Do you get the same updating both domains behaviour? This will possibly help narrow down if the problem is on the OpenWrt side, or the No IP side.

2 Likes

@lantis1008 made a good suggestion to test the update process manually. Also, it sounds like you do have two A records corresponding to the two subdomains (sites), so the other thing to check is that the domain settings (within your no-ip account/domain settings) don't have some sort of 'universal' update, but rather that they allow you to update each subdomain explicitly and separately. You can even test this with the manual command using 2 arbitrary IP addresses for the two sites (they don't even have to be real/routable, just to see what happens with the updates).

2 Likes

This is not normal behavior. After testing individual updates, can you provide the /etc/config/ddns from both devices - please omit things like username and password, and obscure your domain names.

Also, please confirm you downloaded the NOIP DDNS script package.

1 Like

Accessing the dynupdate.no-ip.com/nic/update URL as indicated above does indeed update only, say, site2.example.com, not example.com.

# Site 1 (CNAME points site1.example.com at example.com):
config service 'examplecom'                                                                      
	option service_name 'no-ip.com'                                                       
	option enabled '1'                                                                    
	option username 'user'                                                       
	option password 'pass'                                                        
	option domain 'example.com'                                                              
	option interface 'wan'                                                                
	option use_https '1'                                                                  
	option cacert '/etc/ssl/certs'                                                        
	option use_syslog '3'                                                                 
	option lookup_host 'example.com'

# Site 2 (seems to update example.com too):
config service 'site2examplecom'
	option service_name 'no-ip.com'
	option enabled '1'
	option username 'user'
	option password 'pass'
	option domain 'site2.example.com'
	option interface 'wan'
	option use_https '1'
	option cacert '/etc/ssl/certs'
	option use_syslog '3'
	option lookup_host 'site2.example.com'
'''```

You need a FQDN for site 1.

???

  • Since I can't test this, can't verify it's working.
  • Why are you not using site1? (Nevermind, I see you're trying to run a webserver, and CNAMES should not be placed in root.)

I'm almost sure an update to the "base" domain name, edits all subdomians.

You can also use sub accounts to be certain only one can update each; but I don't think that'll work for the same domain.

  • Can you just test actually using site1???
  • Are these setup as 2 separated domains in your NOIP account? (I can't imagine so)