Arama Yap Mesaj Submit
Request a Callback
+90
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro

Contact Us

Location Halkali merkez neighborhood fatih st ozgur apt no 46 , Kucukcekmece , Istanbul , 34303 , TR
Bulk domain automation

Bulk-add hundreds of domains to a DirectAdmin account with temporary API access

DirectAdmin's da api-url command generates a short-lived Login Key for the target user. Combined with CMD_API_DOMAIN, it can create hundreds of domains without storing the panel password in plaintext.

DirectAdmin API CMD_API_DOMAIN Login Keys SSH curl dataskq
root@eka-server
API_URL="$(da api-url --user=siteuser)"
curl -ksS -X POST "${API_URL}/CMD_API_DOMAIN" -d action=create -d domain=ornek.com -d uquota=unlimited -d ubandwidth=unlimited -d ssl=ON -d php=ON
da docs-root
100+Domains under one user
APICMD_API_DOMAIN workflow
KeyShort-lived access
JSONDocument-root verification
01
Architecture decision

Choose the correct hosting model before adding hundreds of domains

Bulk automation should not accelerate a wrong architecture. Decide customer isolation, resource limits, application roots, mail and DNS ownership first.

01

Domains under an existing user

Collects domains belonging to the same customer within the user's vdomains and quota limits.

02

Separate DirectAdmin users

For different customers and security boundaries, create user accounts with packages first.

03

Temporary Login Key

da api-url generates short-lived credentials for each use and is safer than embedding a permanent admin password.

04

Web server selection

DirectAdmin may use Apache, nginx+Apache, nginx or OpenLiteSpeed templates. Let the panel API handle domain creation.

02
Prerequisites

Requirements to complete before the bulk operation

Root SSH access and a working DirectAdmin binary01
Login Keys and sufficient vdomains limit on the target user02
curl, sed, awk and sha256sum utilities03
A clean UTF-8 list with one domain per line04
User access to the selected IP, DNS and PHP features05
Backup of DirectAdmin user configuration and DNS zones06
03
Implementation order

A controlled and recoverable bulk-add workflow

01

Verify target user limits

Ensure vdomains, quota, bandwidth, DNS and PHP features can accommodate new domains.

grep -E '^(vdomains|quota|bandwidth|dnscontrol|php)=' /usr/local/directadmin/data/users/siteuser/user.conf
02

Test the temporary API URL

Read the domain list in the target user's context without using a permanent password.

curl -ksS "$(da api-url --user=siteuser)/CMD_API_SHOW_DOMAINS"
03

Run a two-domain trial

Confirm that the API returns error=0 and web server templates are generated.

head -n 2 /root/domainler.txt > /root/domainler-test.txt
04

Run the bulk script

A new short-lived API URL is generated before each request and the response is stored in CSV.

chmod 700 /root/directadmin-toplu-domain.sh
/root/directadmin-toplu-domain.sh
05

Monitor task queue and web configuration

Check DirectAdmin background tasks and web server template generation.

tail -f /var/log/directadmin/system.log
/usr/local/directadmin/dataskq d
06

Verify document-root inventory

Use da docs-root to display actual HTTP and HTTPS paths as JSON.

da docs-root
04
SSH, CLI and API

Copy-ready commands and complete automation script

01

DirectAdmin bulk API script

Includes short-lived Login Keys, domain validation, CSV results and error logging.

#!/usr/bin/env bash
set -Eeuo pipefail

DOMAIN_DOSYASI="/root/domainler.txt"
HEDEF_KULLANICI="siteuser"
SONUC="/root/directadmin-domain-sonuclari.csv"
HATA="/root/directadmin-domain-errorlari.log"

[[ "$EUID" -eq 0 ]] || { echo "root gerekli"; exit 1; }
[[ -f "$DOMAIN_DOSYASI" ]] || { echo "domain listesi bulunamadi"; exit 1; }

printf '"domain","durum","kullanici","yanit"\n' > "$SONUC"
: > "$HATA"
chmod 600 "$SONUC" "$HATA"

while IFS= read -r SATIR || [[ -n "$SATIR" ]]; do
    DOMAIN="$(printf '%s' "$SATIR" | tr -d '\r' | tr '[:upper:]' '[:lower:]' | sed -E 's#^[[:space:]]+##;s#[[:space:]]+$##;s#^https?://##;s#^www\.##;s#/.*$##')"
    [[ -z "$DOMAIN" ]] && continue
    [[ "$DOMAIN" == \#* ]] && continue

    if [[ ! "$DOMAIN" =~ ^[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$ ]]; then
        printf '"%s","gecersiz","%s",""\n' "$DOMAIN" "$HEDEF_KULLANICI" >> "$SONUC"
        continue
    fi

    API_URL="$(da api-url --user="$HEDEF_KULLANICI" | sed -n 's/^URL:[[:space:]]*//p')"
    [[ -n "$API_URL" ]] || API_URL="$(da api-url --user="$HEDEF_KULLANICI")"

    YANIT="$(curl -ksS --request POST "${API_URL}/CMD_API_DOMAIN" \
        --data-urlencode "action=create" \
        --data-urlencode "domain=${DOMAIN}" \
        --data-urlencode "ubandwidth=unlimited" \
        --data-urlencode "uquota=unlimited" \
        --data-urlencode "ssl=ON" \
        --data-urlencode "cgi=OFF" \
        --data-urlencode "php=ON" 2>&1 || true)"

    HATA_KODU="$(printf '%s' "$YANIT" | tr '&' '\n' | awk -F= '$1=="error"{print $2}' | head -n1)"
    if [[ "$HATA_KODU" == "0" ]]; then
        TEMIZ="$(printf '%s' "$YANIT" | tr '\n' ' ' | sed 's/"/""/g')"
        printf '"%s","basarili","%s","%s"\n' "$DOMAIN" "$HEDEF_KULLANICI" "$TEMIZ" >> "$SONUC"
    else
        printf '%s | %s\n' "$DOMAIN" "$YANIT" >> "$HATA"
        TEMIZ="$(printf '%s' "$YANIT" | tr '\n' ' ' | sed 's/"/""/g')"
        printf '"%s","errorli","%s","%s"\n' "$DOMAIN" "$HEDEF_KULLANICI" "$TEMIZ" >> "$SONUC"
    fi
done < "$DOMAIN_DOSYASI"

echo "Tamamlandi: $SONUC"
echo "Errorlar: $HATA"
02

Single-domain API test

Validate the same POST parameters with one domain before bulk processing.

API_URL="$(da api-url --user=siteuser | sed -n 's/^URL:[[:space:]]*//p')"
curl -ksS -X POST "${API_URL}/CMD_API_DOMAIN" --data-urlencode action=create --data-urlencode domain=ornek.com --data-urlencode ubandwidth=unlimited --data-urlencode uquota=unlimited --data-urlencode ssl=ON --data-urlencode cgi=OFF --data-urlencode php=ON
03

List user domains

Fetch existing domains through the API to prevent duplicate creation.

curl -ksS "$(da api-url --user=siteuser)/CMD_API_SHOW_DOMAINS"
04

Rewrite web server configuration

Run only when verified necessary after template changes or broken vhosts.

cd /usr/local/directadmin/custombuild
./build rewrite_confs
systemctl reload httpd 2>/dev/null || systemctl reload nginx
05
Operating system and stack

What changes by distribution and web server

Apache

In standard DirectAdmin setups, domain vhosts are generated from user data; avoid manual vhost additions.

  • da docs-root
  • httpd -t
  • systemctl reload httpd

nginx + Apache

nginx may be the front end and Apache the backend. Test and check reload status for both configurations.

  • nginx -t
  • httpd -t
  • systemctl reload nginx && systemctl reload httpd

OpenLiteSpeed

Use DirectAdmin templates and CustomBuild management; do not assume Apache/nginx paths.

  • cd /usr/local/directadmin/custombuild && ./build options | grep -i webserver
  • systemctl status openlitespeed --no-pager
  • da docs-root
06
Troubleshooting

Common errors during bulk domain creation

5 entries
Error message

error=1&text=Cannot create domain

The domain may already exist, the user's vdomains limit may be reached or syntax may be rejected.

Error message

Authentication failed

The Login Key may have expired, the wrong user context may be used or the API URL may be parsed incorrectly.

Error message

Domain already exists

The domain may exist under another DirectAdmin user, as a pointer or as a DNS zone.

Error message

dataskq backlog

Hundreds of domains can queue web, DNS, mail and SSL tasks and cause delays.

Error message

Web server config test failed

A custom CustomBuild template, invalid rewrite or conflicting domain definition may exist.

No matching error was found.

Security and operational risks

Do not go to production before these checks

  • Run the first execution with 2 test domains; do not push the complete domain list directly to production.
  • Prepare the domain list as plain domain names without HTTPS, www or paths.
  • Back up panel configuration, DNS zones and web server files before the operation.
  • Never store API keys, root passwords or generated user passwords in the web root.
  • Requesting bulk SSL before DNS propagation completes can cause rate limits and failed validation.
Verification checklist

Criteria for a successful operation

  • Domains appear in the panel or web server listing.
  • Each domain resolves to the correct document root directory.
  • The HTTP request returns the expected status code.
  • DNS A/AAAA records point to the correct server IP address.
  • Failed records are written to a separate log and can be retried.
  • SSL is enabled only for domains that pass DNS validation.
07
Frequently asked questions

DirectAdmin bulk domain management answers

Is da api-url secure?

It generates a short-lived Login Key. Do not log or cache the output and avoid exposing it in process listings.

Which fields does CMD_API_DOMAIN require?

The official legacy API documentation lists action=create, domain, bandwidth/quota options and ssl, cgi and php flags.

Can the same domain be added to two users?

No. Domain, pointer and DNS-zone conflicts must be prevented. Check ownership server-wide first.

Which web servers can DirectAdmin use?

Depending on the installation, Apache, nginx+Apache, nginx or OpenLiteSpeed may be used. Adding domains through the panel API handles these differences.

Can hundreds of domains under one user cause performance issues?

Performance depends more on vhosts, certificates, logs, mail, PHP workers and application load than the raw domain count. Measure file descriptors and reload time.

Is there an SEO ranking guarantee?

No. This page is built to be crawlable and structured-data friendly, but final rankings cannot be guaranteed.

08
Topic cluster

Other bulk domain addition guides

09
Primary sources

Official panel, web server and Google documentation

EKA SOFTWARE AND INFORMATION SYSTEMS

Plan your large-scale domain migration without data loss or downtime

We implement panel selection, DNS, SSL, web server, security, backup and verification according to your actual server architecture.

Top