While single hostnames can be easily validated via the HTTP-01 challenge, wildcard certificates (*.example.com) strictly require the DNS-01 challenge.
Using the official Netcup DNS API, you can completely automate the creation and removal of temporary _acme-challenge TXT records.
In this guide, we walk through the setup using the two most popular ACME clients: the lightweight shell client acme.sh and the industry-standard Certbot, including automated reloads for Nginx and Docker.
Automated DNS-01 Challenge via Netcup API
1. Generate API Credentials in the Netcup CCP
Before running any commands on your server, you need your individual Netcup API credentials:
- Log in to the Customer Control Panel (CCP).
- In the left navigation bar, go to Master Data (Stammdaten) ➔ API.
- Click the Generate new API key (Neuen API-Schlüssel generieren) button.
- Securely store the following three values in your password manager:
- Customer Number (
NC_CID): Your 5- to 6-digit Netcup customer ID. - API Key (
NC_Apikey): A 32-character alphanumeric key. - API Password (
NC_ApiPw): The generated secret password used to authenticate API sessions.
- Customer Number (
- Make sure the API status is set to Active (Aktiv).
2. Method A: Setup with acme.sh (Recommended)
acme.sh is an ultra-lightweight, pure POSIX shell script client with zero heavy Python dependencies and built-in native support for the Netcup DNS API.
Step 1: Install acme.sh on your server
Run the following commands on your Netcup Root Server or VPS:
# Install acme.sh with your email address for Let's Encrypt expiry notifications
curl https://get.acme.sh | sh -s email=admin@example.de
# Reload shell environment
source ~/.bashrc
Step 2: Configure API credentials
Export your Netcup credentials as environment variables. After the first successful run, acme.sh automatically stores them in ~/.acme.sh/account.conf:
export NC_CID="123456" # Your Netcup Customer ID
export NC_Apikey="your_32_character_api_key" # Your API Key
export NC_ApiPw="your_secret_api_password" # Your API Password
Step 3: Request a wildcard certificate with DNS sleep
[!IMPORTANT] Because Netcup nameservers require a brief propagation window for global DNS zone synchronization, you must pass the
--dnssleep 180parameter to prevent premature validation failures.
~/.acme.sh/acme.sh --issue \
--dns dns_netcup \
-d example.de \
-d '*.example.de' \
--dnssleep 180
Step 4: Install certificates in Nginx & configure automatic reload hook
Never reference the internal files inside ~/.acme.sh directly in your web server configuration. Instead, use the install-cert command to copy them to their target production directory:
# Create target SSL directory
sudo mkdir -p /etc/nginx/ssl/example.de
# Install certificates and register the Nginx reload hook
~/.acme.sh/acme.sh --install-cert -d example.de \
--key-file /etc/nginx/ssl/example.de/privkey.pem \
--fullchain-file /etc/nginx/ssl/example.de/fullchain.pem \
--reloadcmd "sudo systemctl reload nginx"
Whenever acme.sh renews the certificate every 60 days via its automated cron job, it will automatically execute reloadcmd — 100% maintenance-free.
3. Method B: Setup with Certbot & certbot-dns-netcup
If your infrastructure standardizes on Certbot (EFF), you can use the official community DNS plugin for Netcup.
Step 1: Install Certbot and the Netcup DNS plugin (Debian / Ubuntu)
sudo apt update
sudo apt install -y certbot python3-certbot python3-pip
# Install the Netcup DNS authenticator plugin
sudo pip3 install certbot-dns-netcup --break-system-packages
Step 2: Create a restricted credentials file
Create a protected configuration file at /etc/letsencrypt/netcup.ini:
# /etc/letsencrypt/netcup.ini
dns_netcup_customer_id = 123456
dns_netcup_api_key = your_32_character_api_key
dns_netcup_api_password = your_secret_api_password
Apply strict file permissions so unauthorized system users cannot read your API credentials:
sudo chmod 600 /etc/letsencrypt/netcup.ini
Step 3: Issue the wildcard certificate
sudo certbot certonly \
--authenticator dns-netcup \
--dns-netcup-credentials /etc/letsencrypt/netcup.ini \
--dns-netcup-propagation-seconds 180 \
-d example.de \
-d '*.example.de' \
--post-hook "systemctl reload nginx"
Certbot automatically configures a systemd timer (certbot.timer) that checks for due certificate renewals twice daily.
4. Common Errors & Netcup API Troubleshooting
1. Error: Status: 4013 (Invalid session ID)
- Cause: The API password or key was copied incorrectly (e.g., a trailing whitespace character), or the server’s outbound IP address changed mid-session.
- Solution: Generate a fresh API key pair in the CCP under Master Data -> API and update your environment variables or credentials file.
2. Error: DNS challenge failed: NXDOMAIN looking up TXT for _acme-challenge
- Cause: Let’s Encrypt queried the authoritative nameservers before the new TXT record finished replicating across all Netcup Anycast nodes.
- Solution: Increase the
--dnssleepparameter in acme.sh (or--dns-netcup-propagation-secondsin Certbot) from 120 to180or240seconds.
3. Netcup API Rate Limits
- To protect platform stability, Netcup enforces reasonable rate limits on API endpoints (approximately 20–30 requests per minute per account).
- Avoid requesting dozens of domains in rapid parallel loops. Always test new automation setups against the Let’s Encrypt staging environment (
--staging) to avoid hitting Let’s Encrypt’s weekly production issuance limits.