Devv.CloudflareDdns 1.0.1

dotnet add package Devv.CloudflareDdns --version 1.0.1                
NuGet\Install-Package Devv.CloudflareDdns -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Devv.CloudflareDdns" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Devv.CloudflareDdns --version 1.0.1                
#r "nuget: Devv.CloudflareDdns, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Devv.CloudflareDdns as a Cake Addin
#addin nuget:?package=Devv.CloudflareDdns&version=1.0.1

// Install Devv.CloudflareDdns as a Cake Tool
#tool nuget:?package=Devv.CloudflareDdns&version=1.0.1                

Cloudflare Dynamic DNS Updater

A .NET 8 package to dynamically update Cloudflare DNS records based on changes to your public IP address. This package integrates with Cloudflare's API and automates the process of updating DNS records when the public IP changes.

Features

  • Automatically retrieves your public IP address.
  • Updates DNS records via Cloudflare API when the public IP changes.
  • Configurable via appsettings for ease of use.
  • Supports multiple DNS records.

Installation

You can install the package via NuGet:

dotnet add package Devv.CloudflareDdns

Configuration

Add the required settings to your appsettings.json file:

{
  "CloudFlareDdns": {
    "Email": "YourCloudFlareEmail",
    "Key": "YourCloudFlareKey",
    "Records": [
      {
        "ZoneId": "YourZoneId",
        "DnsRecordId": "YourRecordId",
        "Name": "YourRecordName"
      }
    ]
  }
}

Required Settings

  • Email: Your Cloudflare account email.
  • Key: Your Cloudflare API key (can be found in your Cloudflare dashboard).
  • ZoneId: The ID of your Cloudflare zone.
  • DnsRecordId: The DNS record ID to update.
  • Name: The DNS record name (e.g., example.com).

Usage

  1. In your Program.cs or Startup.cs, add the following to configure the service:
public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
{
    services.AddCloudflareDynamicDns(configuration);
}
  1. The package will automatically run a background service that checks for changes to your public IP every 60 seconds and updates the DNS records if needed.

Example

Below is a basic example of appsettings.json configuration:

{
  "CloudflareDdns": {
    "Email": "example@example.com",
    "Key": "your-api-key",
    "Records": [
      {
        "ZoneId": "zone-id-here",
        "DnsRecordId": "dns-record-id-here",
        "Name": "example.com"
      }
    ]
  }
}

License

This project is licensed under the MIT License.


For more information, visit blog.devv.guru.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 117 9/12/2024
1.0.0 106 9/12/2024