This project implements a Dynamic DNS (DDNS) service in Golang, designed to automate the process of updating DNS records for your domains. It supports integration with Cloudflare and Google Cloud DNS providers, allowing you to keep your DNS records synchronized with the public IP address of your server.
- Dynamic Updates: Automatically updates DNS records based on the current public IP address.
- Provider Support: Works with Cloudflare and Google Cloud DNS providers.
-
Clone the repository:
git clone https://github.com/OsmanTunahan/ddns.git cd ddns
-
Configuration:
Update the
config.json
file with your DNS provider credentials and domain details:
For Cloudflare
{
"dns_provider": "cloudflare",
"api_key": "cloudflare_api_key",
"email": "osmantunahan@icloud.com",
"domain": "awoken.dev",
"log_level": "info"
}
For Google
{
"dns_provider": "google",
"project_id": "google_project_id",
"domain": "awoken.dev",
"log_level": "info"
}
-
Run the service:
Start the DDNS service by running the main executable:
go run main.go
Alternatively, build the binary and run it:
go build -o ddns-service main.go ./ddns-service
-
Logs:
Logs are printed to the console based on the specified
log_level
inconfig.json
. Adjustlog_level
to control the verbosity of logs.