Skip to content

Callback Provider Configuration Guide ​

Callback Provider is a universal custom callback interface that allows you to forward DDNS update requests to any custom HTTP API endpoint or webhook. This provider is highly flexible, supporting GET and POST requests with variable substitution functionality.

Return to All Providers to see more options

Basic Configuration ​

ParameterDescriptionRequiredExample
idCallback URL address with variable substitution support✅https://api.example.com/ddns?domain=__DOMAIN__&ip=__IP__
tokenPOST request parameters (JSON object or JSON string), empty for GET requestsOptional{"api_key": "your_key"} or "{\"api_key\": \"your_key\"}"
endpointOptional API endpoint address, will not participate in variable substitutionOptionalhttps://api.example.com/ddns
dnsFixed value "callback", indicates using callback method✅"callback"

Complete Configuration Example ​

jsonc
{
    "$schema": "https://ddns.newfuture.cc/schema/v4.1.json",
    "dns": "callback",
    "endpoint": "https://api.example.com", // endpoint can be merged with id parameter
    "id": "/ddns?domain=__DOMAIN__&ip=__IP__", // endpoint and id cannot both be empty
    "token": "", // empty string means using GET request, with value uses POST request
    "index4": ["url:http://api.ipify.org", "public"],
    "index6": "public",
    "ipv4": "ddns.newfuture.cc",
    "ipv6": ["ddns.newfuture.cc", "ipv6.ddns.newfuture.cc"]
}

Parameter Description ​

ParameterDescriptionTypeRange/OptionsDefaultParameter Type
index4IPv4 sourceArrayReferencedefaultCommon Config
index6IPv6 sourceArrayReferencedefaultCommon Config
ipv4IPv4 domainsArrayDomain listNoneCommon Config
ipv6IPv6 domainsArrayDomain listNoneCommon Config
proxyProxy settingsArrayReferenceNoneCommon Network
sslSSL verificationBoolean/String"auto", true, falseautoCommon Network
cacheCache settingsBoolean/Stringtrue, false, filepathtrueCommon Config
logLog configurationObjectReferenceNoneCommon Config

Request Methods ​

MethodConditionDescription
GETtoken is emptyUse URL query parameters
POSTtoken is not emptyUse JSON request body

HTTP Responses and Caching ​

Callback accepts only final HTTP statuses from 200 to 299 as success. Empty response bodies, such as HTTP 204 responses, are allowed. HTTP 404, 429, and all other non-2xx statuses are failures. The current IP is not cached as a successful update, so a later synchronization will retry. Callback does not interpret custom business errors in an HTTP 200 response body. To report an update failure, the callback endpoint should return an appropriate non-2xx HTTP status.

GET Request Example ​

jsonc
{
    "$schema": "https://ddns.newfuture.cc/schema/v4.1.json",
    "dns": "callback",
    "id": "https://api.example.com/update?domain=__DOMAIN__&ip=__IP__&type=__RECORDTYPE__",
    "index4": ["url:http://api.ipify.org", "public"],
    "ipv4": "ddns.newfuture.cc"
}
http
GET https://api.example.com/update?domain=ddns.newfuture.cc&ip=192.168.1.100&type=A

POST Request Example ​

jsonc
{
    "$schema": "https://ddns.newfuture.cc/schema/v4.1.json",
    "dns": "callback",
    "endpoint": "https://api.example.com",
    "token": {
        "api_key": "your_secret_key",
        "domain": "__DOMAIN__",
        "value": "__IP__"
    },
    "index4": ["url:http://api.ipify.org", "public"],
    "ipv4": "ddns.newfuture.cc"
}
http
POST https://api.example.com
Content-Type: application/json

{
  "api_key": "your_secret_key",
  "domain": "ddns.newfuture.cc",
  "value": "192.168.1.100"
}

Variable Substitution ​

Callback Provider supports the following built-in variables that are automatically replaced during requests:

VariableDescriptionExample Value
__DOMAIN__Full domain namesub.example.com
__IP__IP address (IPv4 or IPv6)192.168.1.100 or 2001:db8::1
__RECORDTYPE__DNS record typeA, AAAA, CNAME
__TTL__Time to live (seconds)300, 600
__LINE__Resolution linedefault, unicom
__TIMESTAMP__Current timestamp1634567890.123

Usage Scenarios ​

1. Custom Webhook ​

Send DDNS update notifications to custom webhooks:

jsonc
{
    "endpoint": "https://hooks.example.com",
    "id": "/webhook",
    "token": {
        "event": "ddns_update",
        "domain": "__DOMAIN__",
        "new_ip": "__IP__",
        "record_type": "__RECORDTYPE__",
        "timestamp": "__TIMESTAMP__"
    },
    "dns": "callback",
    "index4": ["default"]
}

2. Using String Format Token ​

When you need to dynamically construct complex JSON strings:

jsonc
{
    "id": "https://api.example.com/ddns",
    "token": "{\"auth\": \"your_key\", \"record\": {\"name\": \"__DOMAIN__\", \"value\": \"__IP__\", \"type\": \"__RECORDTYPE__\"}}",
    "dns": "callback"
}

Troubleshooting ​

Debugging Methods ​

  1. Enable Debug: Set "debug": true in configuration
  2. View Logs: Check detailed information in DDNS runtime logs
  3. Test API: Use curl or Postman to test callback API
  4. Network Check: Ensure network connectivity and DNS resolution are normal

Testing Tools ​

You can use online tools to test callback functionality:

bash
# Test GET request using curl
curl "https://httpbin.org/get?domain=test.example.com&ip=192.168.1.1"

# Test POST request using curl
curl -X POST "https://httpbin.org/post" \
  -H "Content-Type: application/json" \
  -d '{"domain": "test.example.com", "ip": "192.168.1.1"}'

Released under the MIT License