Skip to main content

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

Project description

Poetry Ruff codecov Pipeline PyPI - Version

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 that has a Python v3 environment.

This CLI tool plays together nicely with my other project simple-dynamic-dns-aws. If you happen to have an AWS account, you can put together your own Dyn DNS server almost for free.

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.
  --dry-run                       Instead of calling the dynamic DNS provider,
                                  print the URL which would have been called.
  --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
DYNAMIC_DNS_UPDATE_CLIENT_DRY_RUN=0

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.3.1.tar.gz (6.2 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.3.1-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dynamic_dns_update_client-0.3.1.tar.gz
  • Upload date:
  • Size: 6.2 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.3.1.tar.gz
Algorithm Hash digest
SHA256 4502a103580673503dd22966a7d3f62ca460ef9cf66ab30f0480657962027a8c
MD5 460bcd1723c0d0db180ff9463c2d6fd8
BLAKE2b-256 5441f76897f528d648af347652d44274f0d9affafd71566e26c6803fe0ff4e76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dynamic_dns_update_client-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 551627e3ce3edfb1e6768a422555a47ab2a3c1fa1d35eaeb994de30776c50666
MD5 aec3a700c9acff75be8e491bc62b007a
BLAKE2b-256 9ff76723246f68c8c9f8ddad0c2156a6f826bf69f8d342b046b6475492030929

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