Skip to main content

Updates the Dynamic DNS (DDNS) record for a given subdomain and domain using the Dynu API

Project description

Updates the Dynamic DNS (DDNS) record for a given subdomain and domain using the Dynu API

Tested against Windows 10 / Python 3.10 / Anaconda

pip install dynuipv4update

Update the Dynamic DNS (DDNS) record for a given subdomain and domain using the Dynu API ( https://www.dynu.com/ ).

This function sends a request to the Dynu API to update the IP (v4 only!!) address associated with
the specified subdomain and domain using the provided credentials. It can be used as a
one-time call or as a background thread that periodically updates the IP address.

Args:
	apikey (str): The API key for authentication with the Dynu API.
	subdomain (str): The subdomain to update (e.g., 'bububaba' in 'bububaba.ddnsfree.com').
	domain (str): The domain to update (e.g., 'ddnsfree.com').
	password (str): The password for authentication with Dynu, used to generate a password hash.
	as_thread (bool, optional): If True, run the update as a background thread. Default is True.
	frequency (int, optional): The frequency (in seconds) at which to update the IP address.
		Ignored if as_thread is False. Default is 30 seconds.
	print_update (bool, optional): If True, print updates when the IP address is changed.
		Ignored if as_thread is False. Default is True.

Returns:
	If as_thread is True, returns a thread object representing the background update task.
	If as_thread is False, returns the current IP address for the specified subdomain and domain.

Example:
	subdomain = r"bababu"
	domain = "ddnsfree.com"
	apikey = "xxxxxx"
	sleep_ip_update = 30
	dyn_password = r"xxxxx"


	# one time call
	updatedip = update_dynamic_dns(
		apikey=apikey,
		subdomain=second_level_domain,
		domain=top_level_domain,
		password=dyn_password,
		as_thread=False,
		frequency=30,
		print_update=True,
	)
	print(updatedip)


	# as thread
	update_dynamic_dns(
		apikey=apikey,
		subdomain=second_level_domain,
		domain=top_level_domain,
		password=dyn_password,
		as_thread=True,
		frequency=30,
		print_update=True,
	)
	print(
		ipconfig.allipscans[f"{second_level_domain}.{top_level_domain}"]
	)  # ips are stored here when you use as_thread=True

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

dynuipv4update-0.11.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

dynuipv4update-0.11-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file dynuipv4update-0.11.tar.gz.

File metadata

  • Download URL: dynuipv4update-0.11.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for dynuipv4update-0.11.tar.gz
Algorithm Hash digest
SHA256 9261653b0e96b37581d863a052184c723422805f6f87fddb5cf7389fc3463532
MD5 7144057d439b9fb266e6008271f29f57
BLAKE2b-256 3ef167f681444832cef253df070738b7a28bb943572807ede9ba8124211af208

See more details on using hashes here.

File details

Details for the file dynuipv4update-0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for dynuipv4update-0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 d9a4f77f7d2ebbf9bbdbb54d068beb81ed4e9154233208e1de1dcab92b804434
MD5 c2cc6e3f553824acae6bc8b2f5d73b08
BLAKE2b-256 31d8c9c2b1bab0b927505fefea84149a0fbc5a55c0bbbeb78964d33aa61149c6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page