Ddns-cloudflare


function xdns($ip){
    $header = array(
        'Authorization:  Bearer M3rCj34JvpJw24LfngRtz0oxxxxxxx',
        'Content-Type: application/json',
    );

$url = "https://api.cloudflare.com/client/v4/zones/1179db2dc8f31244f9ee1e5a5ababb61/dns_records/3cc4712dff2d3aaee7716b58c7d88970";
$data = '{"type":"A","name":"home","content":"'.$ip.'"}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
$response = curl_exec($ch);
//echo $data."<hr>".$response;
}

check dns_record
var url = "https://api.cloudflare.com/client/v4/zones/1179db2dc8f31244f9ee1e5a5ababb61/dns_records?type=A&name=home.biston.web.id&page=1&per_page=20&order=type&direction=desc&match=all"

tambah A domain
curl --request POST \
  --url https://api.cloudflare.com/client/v4/zones/6c038b483ca9d406181449d4be0f3d6e/dns_records \
  --header 'authorization: Bearer 3WD1ZGA8Pi22D3RbZl7qxxxxxxxxxxxxxxxxx' \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/json' \
  --data '{"content":"10.66.66.1","data":{},"name":"121.penggebuk.monster","proxiable":true,"proxied":false,"ttl":1,"type":"A","zone_id":"6c038b483ca9d406181449d4be0f3d6e","zone_name":"penggebuk.monster"}'


mikrotik schedule
/tool fetch url="https://target.biston.web.id/target.php"