Devv.CloudflareDdns
1.1.0
dotnet add package Devv.CloudflareDdns --version 1.1.0
NuGet\Install-Package Devv.CloudflareDdns -Version 1.1.0
<PackageReference Include="Devv.CloudflareDdns" Version="1.1.0" />
<PackageVersion Include="Devv.CloudflareDdns" Version="1.1.0" />
<PackageReference Include="Devv.CloudflareDdns" />
paket add Devv.CloudflareDdns --version 1.1.0
#r "nuget: Devv.CloudflareDdns, 1.1.0"
#:package Devv.CloudflareDdns@1.1.0
#addin nuget:?package=Devv.CloudflareDdns&version=1.1.0
#tool nuget:?package=Devv.CloudflareDdns&version=1.1.0
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",
"Proxied": true
}
]
}
}
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
). - Proxied: (Optional) Whether to proxy the DNS record through Cloudflare's CDN (defaults to
true
).
Usage
- In your
Program.cs
orStartup.cs
, add the following to configure the service:
public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
{
services.AddCloudflareDynamicDns(configuration);
}
- 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",
"Proxied": true
}
]
}
}
License
This project is licensed under the MIT License.
For more information, visit blog.devv.guru.
Product | Versions 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- Microsoft.Extensions.DependencyInjection (>= 6.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 6.0.1)
- Microsoft.Extensions.Http (>= 6.0.1)
- Microsoft.Extensions.Http.Polly (>= 6.0.36)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 6.0.1)
- Microsoft.Extensions.Options.DataAnnotations (>= 6.0.1)
-
net8.0
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Http.Polly (>= 8.0.16)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- Microsoft.Extensions.Options.DataAnnotations (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Added configurable Proxied flag for DNS records to control Cloudflare CDN proxying