README.md aktualisiert

This commit is contained in:
Pascal Bouquet 2025-11-22 21:54:20 +01:00
parent 7733773d21
commit 6d52ca548c

View File

@ -1,2 +1,54 @@
# inwx-api-tool
# INWX DNS CLI Tool
This is a set of Python scripts designed to manage DNS records hosted with **INWX** via their **JSON-RPC API**. It provides a simple command-line interface (CLI) to view, add, modify, and delete DNS records without using the INWX web portal.
## Features
* **Login/Logout:** Secure session management with the INWX API.
* **View Records:** List all DNS records for a specified domain (`nameserver.info`).
* **Add Records:** Create new DNS records (A, CNAME, TXT, etc.) (`nameserver.createRecord`).
* **Modify Records:** Update the content or TTL of existing records (`nameserver.updateRecord`).
* **Delete Records:** Remove existing records using their unique ID (`nameserver.deleteRecord`).
## Prerequisites
You need **Python 3** and the `requests` library installed:
```bash
pip install requests
```
##Project Structure
The tool is organized into three files for modularity:
inwx_cli.py The main executable file. Handles user input and the main menu loop.
inwx_config.py Manages global constants (API_ENDPOINT, SESSION_ID), and the core login, logout, and api_call functions.
inwx_dns_functions.py Contains all specific functions for DNS CRUD operations (view, add, update, delete).
Usage
1. Execute the Script
Run the main CLI file from your terminal:
```bash
python3 inwx_cli.py
```
2. Authentication
The script will prompt you for your INWX username and password.
Security Note: It is highly recommended to create a dedicated sub-account in the INWX portal with permissions limited only to DNS management for API access.
3. Menu Options
Follow the on-screen menu to perform operations:
View: Enter the domain name (e.g., example.com) to see a list of all current records, including their unique ID.
Add/Modify/Delete: Use the record ID obtained from the View function to perform subsequent modification or deletion operations.
Environment Variables (Optional)
You can skip the login prompts by exporting your credentials as environment variables:
```bash
export INWX_USER="your_username"
export INWX_PASS="your_password"
python3 inwx_cli.py