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
netcup-dns-0.2.2.tar.gz
(7.9 kB
view hashes)
Built Distribution
Close
Hashes for netcup_dns-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bec0eff7add6c6e1c1a31de38271d5356af99a8e7c82ed17c08584dde6d7671 |
|
MD5 | 874ffe682238e847996634bc326385a2 |
|
BLAKE2b-256 | 1d9ec5afc9fbe0706d60d6bba23a33cc74c65dbaf4799d3eb867a97b14fe652b |