Skip to the content.

Multi-Provider Configuration Guide

GoDNS now supports configuring multiple DNS providers simultaneously, allowing you to manage domains across different DNS services from a single GoDNS instance.

Features

Configuration Options

Option 1: Multi-Provider Configuration

Configure multiple providers with per-domain assignment:

{
  "providers": {
    "Cloudflare": {
      "email": "user@example.com",
      "password": "your-cloudflare-api-token"
    },
    "DNSPod": {
      "login_token": "your-dnspod-token"
    },
    "DigitalOcean": {
      "login_token": "your-digitalocean-api-token"
    }
  },
  "domains": [
    {
      "domain_name": "example.com",
      "sub_domains": ["www", "api"],
      "provider": "Cloudflare"
    },
    {
      "domain_name": "mysite.net",
      "sub_domains": ["mail", "ftp"], 
      "provider": "DNSPod"
    }
  ]
}

Option 2: Legacy Single-Provider (Backward Compatible)

Existing configurations continue to work unchanged:

{
  "provider": "DNSPod",
  "login_token": "your-dnspod-token",
  "domains": [
    {
      "domain_name": "example.com",
      "sub_domains": ["www", "test"]
    }
  ]
}

Option 3: Mixed Configuration

Combine global provider with specific per-domain providers:

{
  "provider": "DNSPod", 
  "login_token": "your-dnspod-token",
  "providers": {
    "Cloudflare": {
      "email": "user@example.com",
      "password": "your-cloudflare-api-token"
    }
  },
  "domains": [
    {
      "domain_name": "oldsite.com",
      "sub_domains": ["www", "mail"]
    },
    {
      "domain_name": "newsite.com", 
      "sub_domains": ["www", "api"],
      "provider": "Cloudflare"
    }
  ]
}

Provider Configuration Fields

Each provider in the providers section supports these common fields:

Domain Configuration

Domains support an optional provider field:

{
  "domain_name": "example.com",
  "sub_domains": ["www", "api", "@"],
  "provider": "Cloudflare"
}

If provider is omitted, the domain uses the global provider setting.

Supported Providers

All existing providers are supported in multi-provider mode. Use these exact provider names in your configuration:

Provider Name Configuration Value Authentication Methods
Cloudflare "Cloudflare" email + password OR login_token
DNSPod "DNSPod" password OR login_token
DigitalOcean "DigitalOcean" login_token
AliDNS "AliDNS" email + password
Google Domains "Google" email + password
Hurricane Electric "HE" password
Dreamhost "Dreamhost" login_token
Duck DNS "DuckDNS" login_token
NoIP "NoIP" email + password
Scaleway "Scaleway" login_token
DynV6 "Dynv6" login_token
Linode "Linode" login_token
Strato "Strato" password
LoopiaSE "LoopiaSE" password
Infomaniak "Infomaniak" password
Hetzner "Hetzner" login_token
OVH "OVH" app_key + app_secret + consumer_key
Dynu "Dynu" password
IONOS "IONOS" login_token
TransIP "TransIP" email + login_token

Important: Provider names are case-sensitive. Use the exact values from the “Configuration Value” column.

Migration Guide

From Single to Multi-Provider

  1. Keep existing config working: No changes needed for current setups
  2. Add new providers gradually:
    {
      "provider": "DNSPod",        // Keep existing
      "login_token": "old-token",
      "providers": {               // Add new providers
        "Cloudflare": {
          "email": "user@example.com",
          "password": "cf-token"
        }
      },
      "domains": [
        {
          "domain_name": "old-domain.com",
          "sub_domains": ["www"]    // Uses DNSPod (global provider)
        },
        {
          "domain_name": "new-domain.com", 
          "sub_domains": ["www"],
          "provider": "Cloudflare"  // Uses Cloudflare
        }
      ]
    }
    
  3. Complete migration: Remove global provider once all domains specify providers

Configuration Examples

See the example configuration files:

Logging and Notifications

Multi-provider configurations include provider information in log messages and notifications:

INFO [2024-01-01T12:00:00Z] Initialized provider: cloudflare
INFO [2024-01-01T12:00:00Z] Initialized provider: dnspod  
INFO [2024-01-01T12:00:00Z] [ www, api ] of example.com (via cloudflare)

Benefits

  1. Consolidation: Manage multiple DNS providers from one GoDNS instance
  2. Flexibility: Use the best provider for each domain
  3. Redundancy: Distribute domains across providers for resilience
  4. Migration: Gradually move domains between providers
  5. Cost Optimization: Use different providers based on pricing/features
  6. Compliance: Meet requirements for geographic distribution

Troubleshooting

Provider Not Found Error

ERROR provider 'cloudflare' not found for domain example.com

Solution:

  1. Ensure the provider is configured in the providers section
  2. Check that you’re using the correct case-sensitive provider name (e.g., "Cloudflare" not "cloudflare")

Authentication Failures

ERROR failed to create provider Cloudflare: authentication failed

Solution: Verify credentials in the provider configuration section and ensure you’re using the correct authentication method for the provider.

Mixed Configuration Issues

If a domain doesn’t specify a provider field, it will use the global provider. Ensure:

  1. Global provider is set when using mixed configuration
  2. All required credentials are provided for the global provider