Skip to main content

A CLI tool for updating the IP address at dynamic DNS providers.

Project description

Poetry Ruff codecov Pipeline

Dynamic DNS Update Client

A CLI tool for updating the IP address at dynamic DNS providers.

Instead of supporting any dynamic DNS provider in the world (like almost any other tool I found), this CLI tool aims to be a flexible tool kit. Using it, you can put together a solution which works for 90% of the use cases.

It obtains the current IP address by different means depending on the --ip-address-provider option:

  • openwrt_network on an OpenWRT device by calling OpenWRT specific functions, specify network with --ip-network
  • interface physical network interface to look for the public IP address, specify interface with --ip-interface
  • by calling one of the following IP address services using an HTTP GET request:

It then updates the obtained IP address with another HTTP GET request at the dynamic DNS provider using the specified URL parameters and authentication method.

You can run it from any machine which has a Python v3 environment.

Install

$ pip install dynamic-dns-update-client 

Usage

For instance, executing:

$ dynamic-dns-update-client https://example.com --ip-address-url-parameter-name ip-address --url-parameter api-token=nd4u33huruffbn

Will result in calling: GET https://example.com/?ip-address=172.16.31.10&api-token=nd4u33huruffbn

$ dynamic-dns-update-client --help
Usage: dynamic-dns-update-client [OPTIONS] DYNAMIC_DNS_PROVIDER_URL

  Dynamic DNS Update Client.

  A CLI tool for updating the IP address for dynamic DNS providers. It obtains
  the current IP address by calling one the following IP address services
  using a HTTP GET request:

  - ipfy: https://www.ipify.org/

  - dyndns: https://help.dyn.com/remote-access-api/checkip-tool/

  It then updates the obtained IP address with another HTTP GET request at the
  dynamic DNS provider using the specified URL parameters and authentication
  method.

Options:
  --ip-address-provider [openwrt_network|interface|ipify|dyndns]
                                  Type of IP address provider. Default: ipify
  --ip-network TEXT               OpenWRT network to look for the public IP
                                  address. Default: wan
  --ip-interface TEXT             Physical interface to look for the public IP
                                  address. Default: eth0
  --ipv6                          Use IP V6 addresses.
  --ip-address-url-parameter-name TEXT
                                  Name of the URL parameter for IP address. It
                                  will be appended to the dynamic DNS provider
                                  URL.  [required]
  --url-parameter URL_PARAMETER   URL parameter which will be appended to the
                                  dynamic DNS provider URL. Format:
                                  param=value
  --basic-auth-username TEXT      Basic Auth username for calling dynamic DNS
                                  provider URL.
  --basic-auth-password TEXT      Basic Auth password for calling dynamic DNS
                                  provider URL.
  --help                          Show this message and exit.

Environment Variables

If you are concerned about security and don't want to use the CLI options for secrets or passwords, you can also use the following environment variables to provide these values to Dynamic DNS Update Client.

DYNAMIC_DNS_UPDATE_CLIENT_IP_ADDRESS_PROVIDER=ipify
DYNAMIC_DNS_UPDATE_CLIENT_IP_NETWORK=wan
DYNAMIC_DNS_UPDATE_CLIENT_IP_INTERFACE=eth0
DYNAMIC_DNS_UPDATE_CLIENT_IPV6=0
DYNAMIC_DNS_UPDATE_CLIENT_IP_ADDRESS_URL_PARAMETER_NAME=ip
DYNAMIC_DNS_UPDATE_CLIENT_URL_PARAMETER="foo=bar boom=bang cat=mouse"
DYNAMIC_DNS_UPDATE_CLIENT_BASIC_AUTH_USERNAME=username
DYNAMIC_DNS_UPDATE_CLIENT_BASIC_AUTH_PASSWORD=password

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

dynamic_dns_update_client-0.2.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

dynamic_dns_update_client-0.2.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file dynamic_dns_update_client-0.2.0.tar.gz.

File metadata

  • Download URL: dynamic_dns_update_client-0.2.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.11.0-1015-azure

File hashes

Hashes for dynamic_dns_update_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9646a6c856ecbf006b8f6e1b533ff491fe55a01c1221032d51e856d84afa6805
MD5 d74d21773f1d53fae3c359b775eb8a69
BLAKE2b-256 33f3b2392c795ce64cdddbf7a831b7d9dfaee7361064cb2e72c16eaf2ea0c667

See more details on using hashes here.

File details

Details for the file dynamic_dns_update_client-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dynamic_dns_update_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e0b943aad9793438aa57b7e74ad50f63edb469994b28c28b76135a91f563e69
MD5 345bc1ae015cc172c2052085c8df830d
BLAKE2b-256 821282142c8e1e6d280d4ba9fcd1423062a4afcbb484d43fa8ee3ca64ee28232

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