netcup-dns/README.md

51 lines
1.1 KiB
Markdown
Raw Normal View History

2023-03-27 21:29:52 +02:00
# netcup DNS
Update DNS A/AAAA records with your current external IP address using the netcup DNS API.
2023-03-27 21:29:52 +02:00
## Installation
On Arch Linux:
```shell
make
```
With `pip`:
```shell
make install-pip
```
2023-03-28 17:16:11 +02:00
## Configuration
For each netcup customer, create a `.json` configuration file inside `/etc/netcup-dpns`.
2023-03-28 17:16:11 +02:00
There is an [example configuration](cfg/example.json).
2023-03-28 17:16:11 +02:00
2023-03-27 21:29:52 +02:00
## TODOs
2023-06-28 12:05:51 +02:00
Caching:
- Add parameter `--cache` which saves retrieved DNS records as JSON files.
- The method `update_record_destination` will then check if the arguments are the same as the saved JSON record.
- Only if they differ, any requests to the API endpoint will be made.
2023-03-27 21:29:52 +02:00
Alternative external IP detection:
```python
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()))
```