Skip to main content

Tool for updating DNS records for domains hosted by https://www.spaceship.com/.

This tool utilizes https://github.com/bwiessneth/spaceship-api.

The script will detect your system’s external IPv4 and/or IPv6 addresses and update the configured DNS records using your Spaceship API credentials.

Installation

pip install spaceship-dns-updater

Usage

Call spaceship-dns-updater from the directory where your config file is placed.

If you have several config files, specify the one you want:

spaceship-dns-updater --config <PATH_TO_YOUR_CONFIG_FILE>

Logs

When running on Windows, the log files are located in:

%LOCALAPPDATA%\spaceship-dns-updater\logs (e.g., C:\Users\YOUR_NAME\AppData\Local\spaceship-dns-updater\logs)

When using Linux/macOS, the log files are written to:

~/.local/state/spaceship-dns-updater/logs

These log files rotate automatically if they exceed 1 MB in size and are retained for up to 30 days.

🕒 Run Automatically with systemd (Linux only)

To run spaceship-dns-updater on a schedule (e.g., every 15 minutes), you can create a user-level systemd timer.

Create the following two files in ~/.config/systemd/user/:

# spaceship-dns-updater.service
[Unit]
Description=Spaceship DNS Updater

[Service]
Type=oneshot
ExecStart=/usr/bin/python3 /home/YOUR_NAME/spaceship-dns-updater/spaceship_dns_updater.py
WorkingDirectory=/home/YOUR_NAME/spaceship-dns-updater
StandardOutput=append:%h/.local/state/spaceship-dns-updater/logs/systemd-output.log
StandardError=append:%h/.local/state/spaceship-dns-updater/logs/systemd-error.log
# spaceship-dns-updater.timer
[Unit]
Description=Run Spaceship DNS Updater every 15 minutes

[Timer]
OnBootSec=5min
OnUnitActiveSec=5min
Persistent=true

[Install]
WantedBy=timers.target

Then enable and start the timer:

systemctl --user daemon-reload
systemctl --user enable --now spaceship-dns-updater.timer

Check status or logs with:

systemctl --user status spaceship-dns-updater.timer
journalctl --user -u spaceship-dns-updater.service

Configuration

Basic Configuration

Create a YAML config file with your domain name, API credentials, and details about the DNS record you want to update.

The most basic config looks like this:

your-domain.com:
    api_key: <YOUR_API_KEY>
    api_secret: <YOUR_API_SECRET>
    records:
        - type: "A"
        name: "@"
        ttl: 1800

Records

For each record you want to update, add it to the list of records:

records:
    - type: "A"
    name: "@"
    ttl: 1800
    - type: "AAAA"
    name: "@"
    ttl: 1800
    - type: "A"
    name: "subdomain"
    ttl: 1800

For records of type A, the IPv4 address obtained from https://www.ipify.org/ will be used. If no IPv4 address is found, the record will be skipped.

Similarly, for records of type AAAA, the IPv6 address retrieved from https://www.ipify.org/ will be used. If no IPv6 address is available, the record will be skipped.

Multiple domains

If you are owner of multiple domains you can add them to the same YAML config file.

your-first-domain.com:
    api_key: <YOUR_API_KEY>
    api_secret: <YOUR_API_SECRET>
    records:
        - type: "A"
        name: "@"
        ttl: 1800

your-second-domain.com:
    api_key: <YOUR_API_KEY>
    api_secret: <YOUR_API_SECRET>
    records:
        - type: "A"
        name: "@"
        ttl: 1800

Metadata

Release files for spaceship-dns-updater 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spaceship-dns-updater 0.1.0
File Size Uploaded
spaceship_dns_updater-0.1.0.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spaceship-dns-updater 0.1.0
File Interpreter ABI Platform
spaceship_dns_updater-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / spaceship_dns_updater-0.1.0.tar.gz

Download URL spaceship_dns_updater-0.1.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5330e54dbc430513d7d86eb838cd2f16a19d3afac7aa8a32eb8c39c4e4128b61
BLAKE2b-256 checksum
How to use checksums
1ad3a92983fa000abbe15f3960c434016ac62cf0b10a0c6e5e92f5a2a9b77d19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.12.1 Windows/11

Release files / spaceship_dns_updater-0.1.0-py3-none-any.whl

Download URL spaceship_dns_updater-0.1.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e90f58a0d1b5081626c879d553ebdbff5a5ac84134bd3e83228dc934c1392837
BLAKE2b-256 checksum
How to use checksums
37570ddcd6411c3b705a4061e9a30c00ef395053b5879a46d9ff0ba59bdd9aab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.12.1 Windows/11

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page