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-directory CFG_DIR]
[--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-directory CFG_DIR
Path to directory where `.json` config files reside.
--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.
TODOs
API backend:
- Currently: nc-dnsapi
- Alternatives:
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
Built Distribution
File details
Details for the file netcup-dns-0.2.3.tar.gz
.
File metadata
- Download URL: netcup-dns-0.2.3.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f626563b944137f883dea65d888e1ffa4cef666e7b8ac7b1d877269bc6a2f49b |
|
MD5 | 696019861a068cb7addbe1c0201fd67a |
|
BLAKE2b-256 | 2c7ef0896a4920974c0b2e248d27f433f2ac8d60836df02e87a4d4d5c0aed309 |
File details
Details for the file netcup_dns-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: netcup_dns-0.2.3-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fc575d0be6cc5bafaa3ee68e818fb79c2a9c47a9bbd954184dbacb9bba6c1cd |
|
MD5 | cf7fa1ac695d1461e71ebb03828a94d6 |
|
BLAKE2b-256 | 7dc9927bffdb132c16980ed078c2d37afccb2b1a2ead72111bb4b98268626442 |