2023-03-27 21:29:52 +02:00
|
|
|
# netcup DNS
|
|
|
|
|
|
|
|
Update DNS records with your current external IP address using the netcup DNS API.
|
|
|
|
|
2023-03-28 17:16:11 +02:00
|
|
|
## Configuration
|
|
|
|
|
|
|
|
For each netcup customer, create a `.ini` configuration file. Here is an example:
|
|
|
|
|
|
|
|
```ini
|
|
|
|
[credentials]
|
|
|
|
customer = 123456
|
|
|
|
api_key = abcdefghijklmnopqrstuvwxyz
|
|
|
|
api_password = abcdefghijklmnopqrstuvwxyz
|
|
|
|
|
|
|
|
[example.com]
|
|
|
|
hostname = @
|
|
|
|
type = A
|
|
|
|
|
|
|
|
[foo.bar]
|
|
|
|
hostname = @
|
|
|
|
type = A
|
|
|
|
```
|
|
|
|
|
2023-03-27 21:29:52 +02:00
|
|
|
## TODOs
|
|
|
|
|
|
|
|
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()))
|
|
|
|
```
|