Skip to content

Repository files navigation

kas-dns

PHP client for the All-Inkl.com KAS API — manage DNS records, including Let's Encrypt ACME DNS-01 challenge automation.

Setup

cp settings.json.example settings.json
# Edit settings.json with your KAS credentials and optional sub-account:
#   "kasserver_user": "v1234567"
#   "kasserver_password": "your-password"
#   "sub_account": "w01a5bd5"          # optional — set if your domain is in a sub-account
chmod 600 settings.json

Alternatively use environment variables:

export KASSERVER_USER=v1234567
export KASSERVER_PASSWORD=your-password
export KASSERVER_SUB_ACCOUNT=w01a5bd5   # optional

Usage

List DNS records

php kas-dns.php list example.com

Add / remove DNS records

php kas-dns.php add test.example.com CNAME example.com
php kas-dns.php add test.example.com A 1.2.3.4 --ttl 3600
php kas-dns.php remove test.example.com CNAME
php kas-dns.php -a w01a5bd5 remove test.example.com A

Let's Encrypt with Certbot

certbot certonly -d example.com --preferred-challenges dns \
    --manual --manual-auth-hook "php /path/to/kas-dns-certbot.php" \
    --manual-cleanup-hook "php /path/to/kas-dns-certbot.php" \
    -m admin@example.com

Let's Encrypt with Lego

EXEC_PATH="php /path/to/kas-dns-lego.php" lego --dns exec \
    --domains example.com --email admin@example.com run

Sub-account support

If your domain lives in a sub-account, set sub_account in settings.json or KASSERVER_SUB_ACCOUNT env var. The main account authenticates, creates a session token, then acts on behalf of the sub-account.

Files

File Purpose
KasClient.php Core library class
kas-dns.php CLI for list/add/remove DNS records
kas-dns-certbot.php Certbot DNS-01 hook
kas-dns-lego.php Lego DNS-01 hook
settings.json KAS credentials (chmod 600)

Requirements

  • PHP 8.0+
  • ext-soap enabled

License

MIT

About

Manage all-inkl (kas) DNS servers via API

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages