Skip to content

Commit 03d5695

Browse files
authored
+ cloudflare proxy
1 parent 1d418d0 commit 03d5695

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cloudflare-ddns.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
define('CLOUDFLARE_EMAIL', 'Your cloudflare email');
44
define('DOMAIN', 'example.com');
55
define('CLOUDFLARE_RECORD', 'AArecord.example.com');
6+
define('CLOUDFLARE_RECORD_PROXIED', true);
67
define('CHECK_SECONDS', 120);
78

89

@@ -47,7 +48,7 @@
4748
$ch = curl_init();
4849
curl_setopt($ch, CURLOPT_URL, 'https://api.cloudflare.com/client/v4/zones/'.CLOUDFLARE_ID.'/dns_records/'.CLOUDFLARE_RECORD_ID);
4950
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
50-
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array('type' => 'A', 'name' => CLOUDFLARE_RECORD, 'content' => $ip)));
51+
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array('type' => 'A', 'name' => CLOUDFLARE_RECORD, 'content' => $ip, 'proxied' => CLOUDFLARE_RECORD_PROXIED)));
5152
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
5253
$headers = array();
5354
$headers[] = 'X-Auth-Email: '.CLOUDFLARE_EMAIL;

0 commit comments

Comments
 (0)