Kenc.Cloudflare
ActiveA modern .NET client library for the Cloudflare API, enabling programmatic management of DNS records, caching rules, and other Cloudflare features.

Code Examples
Basic usage
// Create the client with API token authenticationvar client = new CloudflareClient(new ApiTokenAuthentication("your-api-token"));
// Get zones (domains)var zones = await client.Zones.GetZonesAsync();foreach (var zone in zones){ Console.WriteLine($"Zone: {zone.Name}, Status: {zone.Status}");}
// Get DNS records for a zonevar dnsRecords = await client.Dns.GetDnsRecordsAsync(zones.First().Id);foreach (var record in dnsRecords){ Console.WriteLine($"Record: {record.Name}, Type: {record.Type}, Content: {record.Content}");}Create a DNS record
// Create the clientvar client = new CloudflareClient(new ApiTokenAuthentication("your-api-token"));
// Get the zone ID for your domainvar zones = await client.Zones.GetZonesAsync(new ZoneFilter { Name = "example.com" });var zoneId = zones.First().Id;
// Create a new DNS recordvar newRecord = await client.Dns.CreateDnsRecordAsync( zoneId, new DnsRecordCreate { Type = "A", Name = "api", Content = "192.0.2.1", Ttl = 120, Proxied = true });
Console.WriteLine($"Created record: {newRecord.Id}, {newRecord.Name}");