DDNS
The DDNS feature is designed for servers using dynamic IP addresses. When an Agent reports a new IP every 10 minutes, the Dashboard automatically updates the DNS records based on your configuration.
Why Use Nezha's DDNS Feature?
- Centralized Management: Conveniently manage DDNS settings in the Dashboard without deploying separate DDNS services on each server.
- Enhanced Security: Sensitive information is only stored on the Dashboard server, reducing the risk of data leaks.
Configuration Instructions
DDNS can be configured directly in the Dashboard's admin panel.
Access the DDNS Configuration Page
Navigate to the DDNS option in the menu to open the configuration page.Create a New Configuration
Click New Configuration and fill in the following details:- Name: A unique name for identifying the configuration.
- DDNS Provider: Select the DNS provider.
- Domain (comma-separated): Enter the domains to be updated, separated by commas if multiple. Supports IDNs (Internationalized Domain Names).
- Max Retry Attempts: The maximum number of retries for DDNS updates (default: 3, range: 1–10).
- DDNS Credential 1 and DDNS Credential 2: Optional credentials depending on the provider (see Provider List).
Webhook-Specific Configuration
If using thewebhook
provider, follow the Webhook Configuration Instructions.Enable Options
Enable at least one of DDNS for IPv4 or DDNS for IPv6; otherwise, updates will not occur.Associate with Servers
After adding a DDNS configuration, modify the server settings to enable DDNS functionality:- Enable DDNS: Go to the
Servers
page and enable DDNS for the target server. - DDNS Configuration: Select the appropriate DDNS configuration ID, which can be searched by name.
- Enable DDNS: Go to the
Webhook Configuration Instructions
Webhooks allow you to customize HTTP requests for third-party services or other specialized needs.
Options
- Webhook URL: The URL for the HTTP request, supporting placeholder substitution.
- Webhook Request Method: Choose from
GET
,POST
,PATCH
,DELETE
, orPUT
. - Webhook Request Type: The request body format, either
JSON
orForm
. - Webhook Request Headers: Input headers in JSON format (nested headers are not supported).
- Webhook Request Body: Not used for
GET
andDELETE
. For nested formats, useJSON
.
Placeholders
Placeholder | Description |
---|---|
#ip# | Host IP address |
#domain# | Domain (one domain per request) |
#type# | IP type: "ipv4" or "ipv6" |
#record# | Record type: "A" or "AAAA" |
#access_id# | DDNS Credential 1 |
#access_secret# | DDNS Credential 2 |
Oray Webhook Example
Click to Expand/Collapse
- URL:
http://ddns.oray.com/ph/update?hostname=#domain#&myip=#ip#
- Request Method:
GET
- Request Headers:jsonHere,
{ "Authorization": "Basic pass" }
pass
is the Base64-encoded value of yourusername:password
. For example,user:pass
becomesdXNlcjpwYXNzCg==
. - Notes: Oray only supports A records, so only enable IPv4.
Provider List
Provider | Credential 1 (ID) | Credential 2 (Secret) |
---|---|---|
dummy | ❌ | ❌ |
webhook | Optional | Optional |
cloudflare | ❌ | ✅ |
tencentcloud | ✅ | ✅ |
Viewing Logs
The DDNS logs can be accessed on the Dashboard logs page. If configured correctly, logs will display update statuses. For example:
dashboard_1 | 2024/03/16 23:16:25 NEZHA>> Attempting to update domain (ddns.example.com) DDNS (1/3)
dashboard_1 | 2024/03/16 23:16:28 NEZHA>> Successfully updated domain (ddns.example.com) DDNS