Skip to main content

Update DNS records with your current external IP address using the netcup DNS API.

Project description

netcup-dns

Update DNS A/AAAA records with your current external IP address using the netcup DNS API.

Installation

Install release from PyPI (https://pypi.org/project/netcup-dns/):

pip install netcup-dns

Install release from TestPyPI (https://test.pypi.org/project/netcup-dns/):

pip install -i https://test.pypi.org/simple/ netcup-dns

Build and install on Arch Linux:

make

Build and install with pip:

make install-pip

Configuration

For each netcup customer, create a .json configuration file inside /etc/netcup-dpns.

There is an example configuration.

Usage

usage: netcup-dns [-h] [--config CFG_FILES [CFG_FILES ...]]
                  [--cache-directory CACHE_DIR]
                  [--cache-validity-seconds CACHE_VALIDITY_SECONDS]

Update DNS A/AAAA records with your current external IP address using the
netcup DNS API.

options:
  -h, --help            show this help message and exit
  --config CFG_FILES [CFG_FILES ...]
                        Path to one or more .json configuration files.
  --cache-directory CACHE_DIR
                        Path to cache directory. Retrieved and updated DNS
                        records are cached there.
  --cache-validity-seconds CACHE_VALIDITY_SECONDS
                        Value in seconds for how long cached DNS records are
                        valid. Set to `0` to disable caching.

Examples

Both examples use the same effective configuration. In the second case, personal information such as the API password is stored in a separate configuration file.

netcup-dns --config ./cfg/example.json
netcup-dns --config ./cfg/public.json ./cfg/secret.json

TODOs

API backend:

Alternative external IP detection:

def external_ip_upnp():
    """
    https://stackoverflow.com/a/41385033

    Didn't work for me. Even after double checking fritz.box settings:

    fritz.box > Heimnetz > Netzwerk > Statusinformationen über UPnP übertragen
    """
    import miniupnpc
    u = miniupnpc.UPnP()
    u.discoverdelay = 1000
    u.discover()
    u.selectigd()
    print('external ip address: {}'.format(u.externalipaddress()))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netcup_dns-0.3.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netcup_dns-0.3.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file netcup_dns-0.3.1.tar.gz.

File metadata

  • Download URL: netcup_dns-0.3.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for netcup_dns-0.3.1.tar.gz
Algorithm Hash digest
SHA256 eceea29f7ee15ce93da2474aab5b47e2fe38e8627ad46099ba271b51d70bb017
MD5 b1a150bc4fefc4f6db3a033f16bdca88
BLAKE2b-256 2995130bd7e94b3905969d15ec0e25a9e139845656407394b21660f246d3ad27

See more details on using hashes here.

File details

Details for the file netcup_dns-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: netcup_dns-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for netcup_dns-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1acf9ff2e78a45ec7e632a8afe6ff0854422dc9c7e18cd76ae50a7fafe1a9745
MD5 5b831626f13622e4935072e124d04853
BLAKE2b-256 51733d613dbb4898815e3cf39c25b25b2a41866b2e4bc1e4db1ffdb272618e13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page