CloudFlairDDNS is a collection of PowerShell and Bash scripts designed to dynamically check and update your Cloudflare DNS records. This repository provides tools to manage DNS records efficiently by automating the process of updating DNS records based on your current IP address.
- List DNS Records: Retrieve and list all DNS records for your Cloudflare zones.
- Automated DNS Updates: Automatically update DNS records based on the current IP address.
- PowerShell 5.1 or later (for Windows scripts)
- Bash (for Unix-like systems)
- Cloudflare API key and email
- Clone the repository or download the scripts.
- Save the scripts to a directory on your machine.
- Clone the repository or download the scripts.
- Ensure you have
curl
andjq
installed.
The get-CloudflairDNSList
function retrieves and lists all DNS records for your Cloudflare zones.
get-CloudflairDNSList -AuthEmail "[email protected]" -AuthKey "your-api-key"
The Start-CloudFlairDNSUpdateV2
function starts the automated DNS update process, checking your current IP address and updating DNS records if necessary.
Start-CloudFlairDNSUpdateV2 -AuthEmail "[email protected]" -AuthKey "your-api-key" -FactsPath "C:\powershell\allinfo.csv"
The update.sh
script starts the automated DNS update process, checking your current IP address and updating DNS records if necessary.
./update.sh -e [email protected] -k your-api-key -f /path/to/facts.csv [-v]
The CSV file used for automated DNS updates should have the following columns:
zone_name
zone_id
record_id
record_type
record_name
record_content
Example:
"Zone Name","Zone ID","Record ID","Record Type","Record Name","Record Content"
"example.com","zone-id-1","record-id-1","A","www.example.com","1.2.3.4"
- get-CloudflairDNSList: Retrieves a list of DNS records and formats them.
- Start-CloudFlairDNSUpdateV2: Starts the automated DNS update process with additional parameters.
- update_cloudflare_dns_v2: Updates a DNS record with the given parameters.
- start_cloudflare_dns_update_v2: Starts the automated DNS update process.
# List DNS records
$dnsRecords = get-CloudflairDNSList -AuthEmail "[email protected]" -AuthKey "your-api-key"
$dnsRecords | Format-Table
# Automated DNS update V2
Start-CloudFlairDNSUpdateV2 -AuthEmail "[email protected]" -AuthKey "your-api-key" -FactsPath "C:\powershell\allinfo.csv"
# Automated DNS update V2
./update.sh -e [email protected] -k your-api-key -f /path/to/facts.csv -v
This project is licensed under the MIT License.