No description
  • Python 97.7%
  • Shell 2.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-06-16 13:58:11 +02:00
.claude feat: initial commit 2026-06-16 13:58:11 +02:00
example.zone feat: initial commit 2026-06-16 13:58:11 +02:00
inwx feat: initial commit 2026-06-16 13:58:11 +02:00
inwx_cli.py feat: initial commit 2026-06-16 13:58:11 +02:00
README.md feat: initial commit 2026-06-16 13:58:11 +02:00
requirements.txt feat: initial commit 2026-06-16 13:58:11 +02:00

inwx-cli

A small CLI to manage INWX DNS records and import BIND zone files, built on the official inwx/python-client (inwx-domrobot) and dnspython for zone parsing.

Setup

A virtualenv with the dependencies is already bundled in .venv, and the ./inwx wrapper uses it. To recreate it elsewhere:

python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

Optionally put the wrapper on your PATH:

ln -s "$PWD/inwx" ~/.local/bin/inwx

Usage

1. Log in (stores credentials)

./inwx login

You'll be prompted for username, password, and — if your account uses two-factor auth — the TOTP shared secret (the string encoded in the 2FA QR code). Storing the shared secret lets every later command log in non-interactively. Use --ote to target the INWX OTE test environment.

Credentials are written to ~/.config/inwx-cli/config.json with 0600 permissions. You can override them per-invocation with the environment variables INWX_USER, INWX_PASSWORD, INWX_SHARED_SECRET, INWX_ENV.

./inwx logout   # delete the stored credentials

2. List domains / zones

./inwx domains

3. List a domain's records

./inwx records example.com
./inwx records example.com --type MX        # filter by type
./inwx records example.com --name www       # filter by host label (@ = apex)

4. Add a single record

# name uses the host label; empty or "@" means the zone apex
./inwx add example.com --name www --type A --content 192.0.2.10
./inwx add example.com --name @   --type MX --content mail.example.com --prio 10
./inwx add example.com --name @   --type TXT --content "v=spf1 mx -all" --ttl 300

5. Update or delete a record

Record ids come from inwx records <domain>.

./inwx update-record 11114 --content 192.0.2.20 --ttl 300
./inwx update-record 11113 --prio 20
./inwx delete-record 11114            # asks for confirmation
./inwx delete-record 11114 --yes      # skip the prompt

update-record only changes the fields you pass; everything else is left as-is.

6. Import a BIND zone file

./inwx import example.com ./example.zone --dry-run   # preview only
./inwx import example.com ./example.zone             # actually create records

The importer parses the zone with dnspython (handling $ORIGIN, $TTL, relative names, multi-line records, etc.) and creates one INWX record per entry. Notes:

  • SOA records are skipped (INWX manages the zone's SOA).
  • Apex NS records are skipped by default (they describe the delegation and usually conflict with INWX's own); pass --include-ns to import them.
  • MX/SRV priorities are mapped to INWX's separate prio field.
  • Records that fail to create (e.g. duplicates) are reported and skipped; the rest still import.

Try it against the bundled example.zone with --dry-run to see the mapping.