Kenc.dk

Kenc.Cloudflare

Free and open implementation of the Cloudflare API prtocol v4 in C# .net core, allowing cross-platform automated interaction with Cloudflare.

Kencdk/Kenc.Cloudflare

Code Examples

var cloudflareClient = new CloudflareClientFactory(emailAdr, apiKey, new CloudflareRestClientFactory(httpClientFactory), CloudflareAPIEndpoint.V4Endpoint).Create();
var zone = await cloudflareClient.Zones.GetAsync("kenc.dk");
DNSRecord dnsRecord;
try
{
    dnsRecord = await cloudflareClient.ZoneDNSSettingsClient.CreateRecordAsync(zone.Id, "_dummyrecord", DNSRecordType.TXT, "TXT record entry value", 3600);
}
catch (CloudflareException exception) when (exception.Errors[0].Code == "81057")
{
    Program.LogLine("The DNS entry already exists.");
}

Blog posts tagged with Cloudflare