- THIS PROJECT IS STILL UNDER HEAVY DEVELOPMENT AND IS NOT READY FOR USE -
PyDDNS is a python based Dynamic Domain Name System updater for DreamHost and Cloudflare.
Python 3 with urllib. Should be installed by default, if not use your package manager.
Run the following command in your terminal:
curl -s -S -L https://raw.githubusercontent.com/TORQDL/PyDDNS/master/scripts/install.sh | sh -s -- -v
The script also accepts some options:
-c <channel>
to use specified channel.-r
to reinstall AdGuard Home;-u
to uninstall AdGuard Home;-v
for verbose output;
Note that options -r
and -u
are mutually exclusive.
Please read these instructions.
Configuration is done through JSON in a configuration file. DreamHost and Cloudflare each use different configuration parameters for authentication, but use the same information for updating your DNS records.
PyDDNS supports updating both IPv4 and IPv6 addresses in DNS using A and AAAA records resspectively. It can update the record using either your public IP address (most common) or the local IP address (less common).
DreamHost Specific | Description |
---|---|
api_key |
Your DreamHost API Key Example: ABCD1234EFGH5678 |
Cloudflare Specific | Description |
---|---|
api_token |
Your Clourflare API Token with Zone.DNS permissions Example: 1234567893feefc5f0q5000bfo0c38d90bbeb |
api_key |
Your Cloudflare Global API Key Example: 3feefc5f0q5000bfo0c38d90bbeb123456789 |
account_email |
Your Cloudflare login email address Example: yourname@example.com |
zone_id |
The Zone ID of the site whose DNS you wish to update Example: 5000bfo0c38d90bbeb1234567893feefc5f0q |
proxied |
Whether or not the domain or subdomain should be proxied through Cloudflare. For more information, see Cloudflare's Help Center Boolean: true or false |
Parameters for Both | Description |
---|---|
domain_or_subdomain |
The domain or subdomain Example: example.com or sub.example.com |
ipv4 |
Whether the A record should be updated with an IPv4 address. Boolean: true or false |
ipv6 |
Whether the AAAA record should be updated with an IPv6 address. Boolean: true or false |
local_ip |
Whether the local IP address should be used instead of the public IP address. If set to true , the local IP address will be used.Boolean: true or false |
- DreamHost API Key: you will need your DreamHost API key, configured for all DNS functions.
You can get your API key from the DreamHost Web Panel. For more information on this, please see the DreamHost API Overview.
When configuring your API key, please give it access to All dns functions:
- All dns functions
- dns-add_record
- dns-list_records
- dns-remove_record
It should look similar to this in your list of existing API keys after it is created:
API KEY CREATED COMMENT FUNCTION ACCESS ACTIONS ABCD1234EFGH5678 2021-09-14 09:41:00 PyDDNS Key dns-* ⊗ Destroy
Once you have your API key, you can fill in the dreamhost.json
configuration file as follows:
{
"dns": [
{
"provider": "dreamhost",
"authentication": {
"api_key": "ABCD1234EFGH5678"
},
"records": {
"example.com": {
"ipv4": true,
"ipv6": true,
"local_ip": false
},
"sub.example.com": {
"ipv4": true,
"ipv6": true,
"local_ip": false
}
}
}
]
}
TODO:
- instructions for finding cloudflare API key
- instructions for finding Cloudflare zone id
- instructions for creating API token for DNS
curl -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \ -H "Authorization: Bearer 1234567893feefc5f0q5000bfo0c38d90bbeb" \ -H "Content-Type:application/json"
{
"dns": [
{
"provider": "cloudflare",
"authentication": {
"api_token": "1234567893feefc5f0q5000bfo0c38d90bbeb",
"api_key": "3feefc5f0q5000bfo0c38d90bbeb123456789",
"account_email": "yourname@example.com"
},
"zones": {
"5000bfo0c38d90bbeb1234567893feefc5f0q": {
"records": {
"example.com": {
"ipv4": true,
"ipv6": true,
"proxied": true,
"local_ip": false
},
"sub.example.com": {
"ipv4": true,
"ipv6": true,
"proxied": true,
"local_ip": false
}
}
}
}
}
]
}
TODO:
- running based on automated install script
- running based on git clone
TODO:
- scheduling PyDDNS to run regularly
- scheduling PyDDNS to check for updates via automated script
- scheduling PyDDNS to check for updates via git
PyDDNS was inspired by and uses code from:
Issue labels for the repository are managed using git-labelmaker by Dave Lunny.
Issue tracking and automation are managed on
PyDDNS is licensed under the MIT License, a short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code. This is not legal advice. Learn more about repository licenses.
See the PyDDNS LICENSE
PyDDNS does not collect any usage statistics. However, as it connects to and utilizes the DreamHost and/or Cloudflare APIs, certain information may be collected by DreamHost and/or Cloudflare per their respective privacy policies and terms of use. Please visit DreamHost and Cloudflare for more information.
TODO:
- add links for donations
- text in red
+ text in green
! text in orange
# text in gray
@@ text in purple (and bold)@@