ownDynDNS
ownDynDNS copied to clipboard
Third Level Domains not correctly stripped for netcup API
Currently, a third level domain like third.level.example.com
gets stripped to level.example.com
by getHostname().
Correct would be of course example.com
, otherwise the API responds with 5029, "Can not get DNS records for zone. Domain not found."
Am I correct in the following assumptions?
- Third level domains like third.level.example.com should still be added to the example.com zone.
- Netcup handles this by using "third.level" as the host for a record.
- This script needs to strip the last two or three domain levels, depending on the TLD.
In this case I propose using a separate (optional) parameter for the requests. That way you could manually assign the parent domain and host parts of the address. So instead of using "&domain=third.level.example.com" we could use "&host=third.level&domain=example.com". Might need to use another parameter name for domain, but this should work
Edit: I know it is probably too late, but I added support in my fork, PR with several additions is opened. For anyone interested in the future.