DDNS, DNS, 动态域名解析 Version: Current

DDNS Usage Tutorial

Here is the English translation of the text: First, you need to create a DDNS token for the specified A/AAAA record under "Domain Management →...

Back

Here is the English translation of the text:

First, you need to create a DDNS token for the specified A/AAAA record under "Domain Management → DDNS". The dedicated DDNS token can only modify the IP address of its bound record; it cannot access or modify any other records.

Endpoint: ddns

Action: update

Method: GET, POST, or PUT

Authentication: Authorization: Bearer <DDNS_TOKEN> or X-DDNS-Token. The DDNS token cannot be passed via the URL or the request body.

If no IP address is specified, the direct source IP address of the request will be used:

Bash
 
curl -X POST "https://api005.dnshe.com/index.php?m=domain_hub&endpoint=ddns&action=update" \
-H "Authorization: Bearer ddns_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

You can also explicitly submit an IPv4 or IPv6 address:

Bash
 
curl -X POST "https://api005.dnshe.com/index.php?m=domain_hub&endpoint=ddns&action=update" \
-H "X-DDNS-Token: ddns_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"ip":"192.168.1.1"}'

If the IP update is successful, it returns good. If the IP has not changed, it returns nochg and does not call the DNS provider:

JSON
 
{
  "success": true,
  "status": "nochg",
  "changed": false,
  "ip": "192.168.1.1"
}
2.5.1 Synology DSM and Other Devices

The DDNS update address is [https://api005.dnshe.com](https://api005.dnshe.com). Since the dedicated DDNS token can only be passed through request headers, it is recommended to use the Task Scheduler script in Synology DSM rather than putting the token into the URL template of a third-party DDNS service provider.

  1. Create a token for the target A/AAAA record under "Domain Management → DDNS" and save it immediately.

  2. In DSM, open "Control Panel → Task Scheduler → Create → Scheduled Task → User-defined script". It is recommended to set it to run every 5 minutes, and this interval should not be less than the minimum update interval configured in the background.

  3. Replace the Token below with your actual value, and then run it manually once. In the returned JSON, if the status is good (IP updated) or nochg (IP unchanged), the operation is successful.

Bash
 
#!/bin/sh

TOKEN='ddns_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
URL='https://api005.dnshe.com/index.php?m=domain_hub&endpoint=ddns&action=update'

/usr/bin/curl -fsS -X POST -H "X-DDNS-Token: ${TOKEN}" "${URL}"

If the ip parameter is not passed, the system will use the public IP address of the request source. If you need to specify an IP address, you can pass it in JSON format within the request body, for example: -H "Content-Type: application/json" -d '{"ip":"192.168.1.1"}'.

Was this helpful?

0 helpful votes