# 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
```python
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
```
Raw data
{
"_id": null,
"home_page": "https://github.com/hansalemaos/dynuipv4update",
"name": "dynuipv4update",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "dynamic,ddns",
"author": "Johannes Fischer",
"author_email": "aulasparticularesdealemaosp@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/09/28/dc7c237437159dc23c3e948043d6b6267860102b752491a2dba7adc366ff/dynuipv4update-0.12.tar.gz",
"platform": null,
"description": "\r\n# Updates the Dynamic DNS (DDNS) record for a given subdomain and domain using the Dynu API\r\n\r\n## Tested against Windows 10 / Python 3.10 / Anaconda\r\n\r\n## pip install dynuipv4update\r\n\r\n```python\r\nUpdate the Dynamic DNS (DDNS) record for a given subdomain and domain using the Dynu API ( https://www.dynu.com/ ).\r\n\r\nThis function sends a request to the Dynu API to update the IP (v4 only!!) address associated with\r\nthe specified subdomain and domain using the provided credentials. It can be used as a\r\none-time call or as a background thread that periodically updates the IP address.\r\n\r\nArgs:\r\n\tapikey (str): The API key for authentication with the Dynu API.\r\n\tsubdomain (str): The subdomain to update (e.g., 'bububaba' in 'bububaba.ddnsfree.com').\r\n\tdomain (str): The domain to update (e.g., 'ddnsfree.com').\r\n\tpassword (str): The password for authentication with Dynu, used to generate a password hash.\r\n\tas_thread (bool, optional): If True, run the update as a background thread. Default is True.\r\n\tfrequency (int, optional): The frequency (in seconds) at which to update the IP address.\r\n\t\tIgnored if as_thread is False. Default is 30 seconds.\r\n\tprint_update (bool, optional): If True, print updates when the IP address is changed.\r\n\t\tIgnored if as_thread is False. Default is True.\r\n\r\nReturns:\r\n\tIf as_thread is True, returns a thread object representing the background update task.\r\n\tIf as_thread is False, returns the current IP address for the specified subdomain and domain.\r\n\r\nExample:\r\n\tsubdomain = r\"bababu\"\r\n\tdomain = \"ddnsfree.com\"\r\n\tapikey = \"xxxxxx\"\r\n\tsleep_ip_update = 30\r\n\tdyn_password = r\"xxxxx\"\r\n\r\n\r\n\t# one time call\r\n\tupdatedip = update_dynamic_dns(\r\n\t\tapikey=apikey,\r\n\t\tsubdomain=second_level_domain,\r\n\t\tdomain=top_level_domain,\r\n\t\tpassword=dyn_password,\r\n\t\tas_thread=False,\r\n\t\tfrequency=30,\r\n\t\tprint_update=True,\r\n\t)\r\n\tprint(updatedip)\r\n\r\n\r\n\t# as thread\r\n\tupdate_dynamic_dns(\r\n\t\tapikey=apikey,\r\n\t\tsubdomain=second_level_domain,\r\n\t\tdomain=top_level_domain,\r\n\t\tpassword=dyn_password,\r\n\t\tas_thread=True,\r\n\t\tfrequency=30,\r\n\t\tprint_update=True,\r\n\t)\r\n\tprint(\r\n\t\tipconfig.allipscans[f\"{second_level_domain}.{top_level_domain}\"]\r\n\t) # ips are stored here when you use as_thread=True\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Updates the Dynamic DNS (DDNS) record for a given subdomain and domain using the Dynu API",
"version": "0.12",
"project_urls": {
"Homepage": "https://github.com/hansalemaos/dynuipv4update"
},
"split_keywords": [
"dynamic",
"ddns"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3c13ce510ca93f59362b9e39a1a99a9ce13a3f20314765458729128138fa874b",
"md5": "663de5b37de3646029509c4279c633fe",
"sha256": "9408a4436203b8ee068b3c6e05adaed90e3919d1ba51cded77a595b0eae7c18d"
},
"downloads": -1,
"filename": "dynuipv4update-0.12-py3-none-any.whl",
"has_sig": false,
"md5_digest": "663de5b37de3646029509c4279c633fe",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10228,
"upload_time": "2023-09-05T04:50:34",
"upload_time_iso_8601": "2023-09-05T04:50:34.505435Z",
"url": "https://files.pythonhosted.org/packages/3c/13/ce510ca93f59362b9e39a1a99a9ce13a3f20314765458729128138fa874b/dynuipv4update-0.12-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0928dc7c237437159dc23c3e948043d6b6267860102b752491a2dba7adc366ff",
"md5": "0eae42f3e4b34d80622e50235512b4d8",
"sha256": "b082f3c11a99bec91c32b14be9e52a9fe5b2f1bf2a4ae1cc3e6c71d04e6d3c33"
},
"downloads": -1,
"filename": "dynuipv4update-0.12.tar.gz",
"has_sig": false,
"md5_digest": "0eae42f3e4b34d80622e50235512b4d8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8273,
"upload_time": "2023-09-05T04:50:36",
"upload_time_iso_8601": "2023-09-05T04:50:36.164602Z",
"url": "https://files.pythonhosted.org/packages/09/28/dc7c237437159dc23c3e948043d6b6267860102b752491a2dba7adc366ff/dynuipv4update-0.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-05 04:50:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hansalemaos",
"github_project": "dynuipv4update",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "dynuipv4update"
}