-
-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
ZoneKit supports multiple accounts, allowing you to manage domains across different DNS provider accounts from a single tool.
Tip: You can switch between accounts easily or use a specific account for individual commands.
The tool automatically detects configuration files in this priority order:
| Priority | Location | Use Case |
|---|---|---|
| 1 | ./configs/.zonekit.yaml |
Development (project directory) |
| 2 | ~/.zonekit.yaml |
Production (home directory) |
| 3 | --config /path/to/config.yaml |
Custom location (via flag) |
Note: The first found config file is used. Project directory config takes precedence.
View complete configuration example
accounts:
default:
provider: "namecheap" # DNS provider: "namecheap", "cloudflare", etc.
username: "your-namecheap-username"
api_user: "your-api-username"
api_key: "your-api-key-here"
client_ip: "your.public.ip.address"
use_sandbox: false
description: "My main account"
work:
provider: "namecheap"
username: "work-username"
api_user: "work-api-username"
api_key: "work-api-key"
client_ip: "your.public.ip.address"
use_sandbox: false
description: "Work account"
sandbox:
provider: "namecheap"
username: "sandbox-username"
api_user: "sandbox-api-user"
api_key: "sandbox-api-key"
client_ip: "your.public.ip.address"
use_sandbox: true
description: "Testing environment"
# Example: Cloudflare account (when Cloudflare provider is implemented)
# cloudflare:
# provider: "cloudflare"
# api_key: "your-cloudflare-api-key"
# email: "your-email@example.com"
# description: "Cloudflare account"
current_account: "default"| Field | Required | Description | Example |
|---|---|---|---|
provider |
No | DNS provider name (defaults to "namecheap") |
"namecheap", "cloudflare"
|
username |
Yes* | Provider account username | "myusername" |
api_user |
Yes* | API username (may differ from username) | "myapiuser" |
api_key |
Yes* | API key from provider | "abc123..." |
client_ip |
Yes* | Your public IP address (required for Namecheap) | "203.0.113.1" |
use_sandbox |
No | Use sandbox environment (default: false) |
true or false
|
description |
No | Account description | "My main account" |
Note: Fields marked with * are required for Namecheap provider. Other providers may have different required fields.
- Log in to your Namecheap account
- Go to Profile → Tools → API Access
- Enable API access
- Note your:
- API User: Your API username
- API Key: Your API key
- Whitelisted IP: Your public IP address
Different DNS providers have different authentication methods. Refer to each provider's documentation for their specific API credential requirements.
# Add an account interactively
zonekit account add
# Or add with a specific name
zonekit account add personal-
Create the config file:
zonekit config init
-
Edit the config file:
# Edit ~/.zonekit.yaml or ./configs/.zonekit.yaml vim ~/.zonekit.yaml
-
Validate your configuration:
zonekit config validate
zonekit account listzonekit account switch workzonekit --account work domain listzonekit account edit workzonekit account remove work-
File Permissions: Configuration files use
600permissions (owner read/write only) - API Keys: Are masked in output (shows only first 4 and last 4 characters)
- Git Ignore: Configuration files are excluded from git by default
-
Sandbox Mode: Use
use_sandbox: truefor testing
For testing, you can use the provider's sandbox environment (currently supported for Namecheap):
accounts:
test:
provider: "namecheap"
username: "sandbox-username"
api_user: "sandbox-api-user"
api_key: "sandbox-api-key"
client_ip: "your.public.ip.address"
use_sandbox: true
description: "Sandbox for testing"Run:
zonekit config initCheck available accounts:
zonekit account list- Verify your API key is correct
- Check that your client IP is whitelisted (for Namecheap provider)
- Ensure you're not using sandbox credentials in production
- Verify your IP hasn't changed (update if needed)
- Confirm the
providerfield matches the provider you're trying to use
If you have an existing single-account configuration, the tool will automatically migrate it to the new multi-account format. Your existing configuration will be preserved as the default account.