From 9c22ce6b7457ead8fed5517c54c95ec6c5792161 Mon Sep 17 00:00:00 2001 From: 29039 <61966298+29039@users.noreply.github.com> Date: Thu, 23 Nov 2023 12:22:23 +1100 Subject: [PATCH 1/9] Support for adding comments to DNS record --- update-cloudflare-dns_conf.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/update-cloudflare-dns_conf.ps1 b/update-cloudflare-dns_conf.ps1 index 3042ae2..b172d9a 100644 --- a/update-cloudflare-dns_conf.ps1 +++ b/update-cloudflare-dns_conf.ps1 @@ -15,6 +15,8 @@ $zoneid = "ChangeMe" $cloudflare_zone_api_token = "ChangeMe" ## Use Cloudflare proxy on dns record true/false $proxied = $false +## Comment to put on the updated record +$comment = "Updated using the update-cloudflare-dns.ps1 script" ## 60-7200 in seconds or 1 for Auto $ttl = 120 From adf9283d42cba7a7bb40a482b8096c59fe576e51 Mon Sep 17 00:00:00 2001 From: 29039 <61966298+29039@users.noreply.github.com> Date: Thu, 23 Nov 2023 12:23:05 +1100 Subject: [PATCH 2/9] Comment support --- update-cloudflare-dns.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/update-cloudflare-dns.ps1 b/update-cloudflare-dns.ps1 index 9d44ee2..a6b2416 100644 --- a/update-cloudflare-dns.ps1 +++ b/update-cloudflare-dns.ps1 @@ -181,6 +181,7 @@ $update_dns_record = @{ "content" = $ip "ttl" = $ttl "proxied" = $proxied + "comment" = $comment } | ConvertTo-Json } From dc2fac921937e05e589a893f19a2ba7f05d4fadb Mon Sep 17 00:00:00 2001 From: 29039 <61966298+29039@users.noreply.github.com> Date: Thu, 23 Nov 2023 12:24:17 +1100 Subject: [PATCH 3/9] Support for adding a comment to the DNS record --- update-cloudflare-dns_conf.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/update-cloudflare-dns_conf.ps1 b/update-cloudflare-dns_conf.ps1 index 3042ae2..b172d9a 100644 --- a/update-cloudflare-dns_conf.ps1 +++ b/update-cloudflare-dns_conf.ps1 @@ -15,6 +15,8 @@ $zoneid = "ChangeMe" $cloudflare_zone_api_token = "ChangeMe" ## Use Cloudflare proxy on dns record true/false $proxied = $false +## Comment to put on the updated record +$comment = "Updated using the update-cloudflare-dns.ps1 script" ## 60-7200 in seconds or 1 for Auto $ttl = 120 From 1b266cf421b224d0d88a714cdc03860315ebddbc Mon Sep 17 00:00:00 2001 From: 29039 <61966298+29039@users.noreply.github.com> Date: Thu, 23 Nov 2023 12:25:29 +1100 Subject: [PATCH 4/9] Support for adding a comment to the DNS record --- update-cloudflare-dns.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/update-cloudflare-dns.ps1 b/update-cloudflare-dns.ps1 index 9d44ee2..a6b2416 100644 --- a/update-cloudflare-dns.ps1 +++ b/update-cloudflare-dns.ps1 @@ -181,6 +181,7 @@ $update_dns_record = @{ "content" = $ip "ttl" = $ttl "proxied" = $proxied + "comment" = $comment } | ConvertTo-Json } From 598dd889beaab276a32dd782615bfb2d89856423 Mon Sep 17 00:00:00 2001 From: 29039 <61966298+29039@users.noreply.github.com> Date: Thu, 23 Nov 2023 12:33:58 +1100 Subject: [PATCH 5/9] Support for adding a comment to the DNS record --- README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 516e299..09344e0 100644 --- a/README.md +++ b/README.md @@ -37,14 +37,15 @@ rename the folder to _DDNS-Cloudflare-PowerShell_ place in a directory of your c Update the config parameters inside the update-cloudflare-dns_conf.ps1 by editing accordingly. See below for examples. -| **Option** | **Example** | **Description** | -| ------------------------- | ---------------- | --------------------------------------------------------- | -| what_ip | internal | Which IP should be used for the record: internal/external | -| dns_record | ddns.example.com | DNS **A** record which will be updated | -| cloudflare_zone_api_token | ChangeMe | Cloudflare API Token **KEEP IT PRIVATE!!!!** | -| zoneid | ChangeMe | Cloudflare's Zone ID | -| proxied | false | Use Cloudflare proxy on dns record true/false | -| ttl | 120 | 120-7200 in seconds or 1 for Auto | +| **Option** | **Example** | **Description** | +| ------------------------- | ---------------------------------------- | --------------------------------------------------------- | +| what_ip | internal | Which IP should be used for the record: internal/external | +| dns_record | ddns.example.com | DNS **A** record which will be updated | +| cloudflare_zone_api_token | ChangeMe | Cloudflare API Token **KEEP IT PRIVATE!!!!** | +| zoneid | ChangeMe | Cloudflare's Zone ID | +| proxied | false | Use Cloudflare proxy on dns record true/false | +| ttl | 120 | 120-7200 in seconds or 1 for Auto | +| comment | Updated using DDNS-Cloudflare-PowerShell | For record keeping, no effect on DNS itself | ### Optional Notifications Parameters for Telegram From b526a04fa820c24edd1f29d97dd61707d88a3eed Mon Sep 17 00:00:00 2001 From: 29039 <61966298+29039@users.noreply.github.com> Date: Thu, 23 Nov 2023 12:34:24 +1100 Subject: [PATCH 6/9] Updated using DDNS-Cloudflare-PowerShell --- update-cloudflare-dns_conf.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update-cloudflare-dns_conf.ps1 b/update-cloudflare-dns_conf.ps1 index b172d9a..87f0327 100644 --- a/update-cloudflare-dns_conf.ps1 +++ b/update-cloudflare-dns_conf.ps1 @@ -16,7 +16,7 @@ $cloudflare_zone_api_token = "ChangeMe" ## Use Cloudflare proxy on dns record true/false $proxied = $false ## Comment to put on the updated record -$comment = "Updated using the update-cloudflare-dns.ps1 script" +$comment = "Updated using DDNS-Cloudflare-PowerShell" ## 60-7200 in seconds or 1 for Auto $ttl = 120 From 6ac4cfe43bd046bb17a01f16f0ee58bc98b6b6d3 Mon Sep 17 00:00:00 2001 From: 29039 <61966298+29039@users.noreply.github.com> Date: Thu, 23 Nov 2023 12:35:47 +1100 Subject: [PATCH 7/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 09344e0..b6ef160 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Update the config parameters inside the update-cloudflare-dns_conf.ps1 by editin | zoneid | ChangeMe | Cloudflare's Zone ID | | proxied | false | Use Cloudflare proxy on dns record true/false | | ttl | 120 | 120-7200 in seconds or 1 for Auto | -| comment | Updated using DDNS-Cloudflare-PowerShell | For record keeping, no effect on DNS itself | +| comment | Updated using DDNS-Cloudflare-PowerShell | For record keeping, no effect on DNS itself | ### Optional Notifications Parameters for Telegram From ed523f848f43c06370a071fc28349b56f60a2416 Mon Sep 17 00:00:00 2001 From: 29039 <61966298+29039@users.noreply.github.com> Date: Tue, 2 Apr 2024 20:32:39 +1100 Subject: [PATCH 8/9] Update update-cloudflare-dns_conf.ps1 --- update-cloudflare-dns_conf.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update-cloudflare-dns_conf.ps1 b/update-cloudflare-dns_conf.ps1 index 87f0327..e6e879a 100644 --- a/update-cloudflare-dns_conf.ps1 +++ b/update-cloudflare-dns_conf.ps1 @@ -2,21 +2,21 @@ ## Which IP should be used for the record: internal/external ## Internal interface will be chosen automaticly as a primary default interface -$what_ip = "internal" +$what_ip = "external" ## DNS A record to be updated $dns_record = "ddns.example.com" ## Use IPv6 $IPv6 = $false ## if use DoH to query the current IP address $DNS_over_HTTPS = $false -## Cloudflare's Zone ID +## Cloudflare's Zone ID - Cloudflare Dashboard -> Websites -> example.com -> Overview -> API Zone ID on right-hand sidebar $zoneid = "ChangeMe" -## Cloudflare Zone API Token +## Cloudflare Zone API Token - Instructions: https://github.com/fire1ce/DDNS-Cloudflare-PowerShell/blob/main/README.md#creating-cloudflare-api-token $cloudflare_zone_api_token = "ChangeMe" ## Use Cloudflare proxy on dns record true/false $proxied = $false ## Comment to put on the updated record -$comment = "Updated using DDNS-Cloudflare-PowerShell" +$comment = "Updated with fire1ce's DDNS-Cloudflare-PowerShell script $((Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ'))" ## 60-7200 in seconds or 1 for Auto $ttl = 120 From b24bfb4cfcd0ad168db433aff9229d605316c3b6 Mon Sep 17 00:00:00 2001 From: 29039 <61966298+29039@users.noreply.github.com> Date: Tue, 2 Apr 2024 20:37:25 +1100 Subject: [PATCH 9/9] Update update-cloudflare-dns.ps1 --- update-cloudflare-dns.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update-cloudflare-dns.ps1 b/update-cloudflare-dns.ps1 index a6b2416..41389de 100644 --- a/update-cloudflare-dns.ps1 +++ b/update-cloudflare-dns.ps1 @@ -160,7 +160,7 @@ $cloudflare_record_info = @{ $cloudflare_record_info_resposne = Invoke-RestMethod -Proxy $http_proxy -ProxyCredential $proxy_credential @cloudflare_record_info if ($cloudflare_record_info_resposne.success -ne "True") { - Write-Output "Error! Can't get $dns_record record inforamiton from cloudflare API" | Tee-Object $File_LOG -Append + Write-Output "Error! Can't get $dns_record record information from cloudflare API" | Tee-Object $File_LOG -Append Exit } @@ -192,7 +192,7 @@ if ($update_dns_record_response.success -ne "True") { } Write-Output "==> Success!" | Tee-Object $File_LOG -Append -Write-Output "==> $dns_record DNS Record Updated To: $ip, ttl: $ttl, proxied: $proxied" | Tee-Object $File_LOG -Append +Write-Output "==> $dns_record DNS Record Updated To: $ip, ttl: $ttl, proxied: $proxied. `ncomment: $comment" | Tee-Object $File_LOG -Append if ($notify_me_telegram -eq "no" -And $notify_me_discord -eq "no") {