Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soerenschneider/dyndns
Automatically updates DNS records for internet connections that don't have a static IP
https://github.com/soerenschneider/dyndns
aws dynamic-credentials dynamic-dns dyndns dyndns-client dyndns-server ed25519 golang lambda mqtt route53 self-hosted sqs vault-client
Last synced: 14 days ago
JSON representation
Automatically updates DNS records for internet connections that don't have a static IP
- Host: GitHub
- URL: https://github.com/soerenschneider/dyndns
- Owner: soerenschneider
- License: apache-2.0
- Created: 2021-06-03T16:39:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-30T16:03:53.000Z (about 1 month ago)
- Last Synced: 2024-10-04T22:09:43.671Z (about 1 month ago)
- Topics: aws, dynamic-credentials, dynamic-dns, dyndns, dyndns-client, dyndns-server, ed25519, golang, lambda, mqtt, route53, self-hosted, sqs, vault-client
- Language: Go
- Homepage:
- Size: 696 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# dyndns
[![Go Report Card](https://goreportcard.com/badge/github.com/soerenschneider/dyndns)](https://goreportcard.com/report/github.com/soerenschneider/dyndns)
![test-workflow](https://github.com/soerenschneider/dyndns/actions/workflows/test.yaml/badge.svg)
![release-workflow](https://github.com/soerenschneider/dyndns/actions/workflows/release-container.yaml/badge.svg)
![golangci-lint-workflow](https://github.com/soerenschneider/dyndns/actions/workflows/golangci-lint.yaml/badge.svg)Automatically updates DNS records for hosts that don't have a static IP
## Features
๐ฃ Dynamically updates DNS records to match their public IP address
๐ฐ Built-in resiliency for different failure scenarios
๐ข Server component supports running on AWS Lambda
๐ Dispatch update requests via [AWS SQS](https://aws.amazon.com/sqs/), MQTT and/or HTTP API calls
๐ Detect public IP address by network interface's status or by calling HTTP APIs
๐ญ Runs in client / server mode to limit blast-radius of leaked credentials
๐ง Customizable list of HTTP APIs to detect IP updates
โค๏ธ Specify HTTP APIs that detect IP updates which are preferred over other API endpoints
๐ Messages are cryptographically signed, therefore public MQTT brokers can be used
๐ Can use either dynamic credentials using Hashicorp Vault or static credentials
๐ญ Observability through Prometheus metrics## Why would I need it?
๐ You don't have a static public IP address but want to connect to your home network
๐คน Ideally, you have multiple endpoints you want to assign DNS records to## Installation
### AWS Lambda
Run the `lambda-server` Makefile target to build an archive for the `provided.al2` Lambda runtime and the `arm64` architecture. Either create a Lambda function using AWS cli / Console or run the Terraform code to create an API Gateway instance and Lambda function.```shell
$ make lambda-server # build the server component
$ terraform -chdir=deployment/terraform/envs/dev apply # this command will deploy a dyndns-server as a Lambda function which is reachable via a new API Gateway instance
$ terraform -chdir=deployment/terraform/envs/dev output -raw gateway-url # display the url of the API endpoint
```### Docker / Podman
```shell
$ docker pull ghcr.io/soerenschneider/dyndns-server:main
$ docker pull ghcr.io/soerenschneider/dyndns-client:main
```### Binaries
Head over to the [prebuilt binaries](https://github.com/soerenschneider/dyndns/releases) and download the correct binary for your system.### From Source
As a prerequesite, you need to have [Golang SDK](https://go.dev/dl/) installed. After that, you can install dyndns from source by invoking:
```text
$ go install github.com/soerenschneider/dyndns@latest
```## Configuration
Head over to the [configuration section](docs/configuration.md) to see more details.
## Getting Started
First, you need to build a keypair. This is easily done
```bash
$ docker run ghcr.io/soerenschneider/dyndns-client -gen-keypair
{"public_key":"IyXH8z/+vRsIUEAldlGgKKFcVHoll8w2tzC6o9717m8=","private_key":"h7jrhYupN0LVPnVWqFun6sN+bWNr0B0mh7/mgRaKnhsjJcfzP/69GwhQQCV2UaAooVxUeiWXzDa3MLqj3vXubw=="}
```# Architecture
## Client Internals
Client states and client failure scenarios and their remediation is found [here](docs/client.md).## Message format
Data sent over the wire is expected to have the following format, encoded as a JSON message.
### `UpdateRecordRequest` reference
| Field Name | Description | JSON Key | Data Type | Optional |
|-------------|---------------------------------------------|---------------|-------------|----------|
| `PublicIp` | The resolved IP address. | `"public_ip"` | `DnsRecord` | No |
| `Signature` | The signature associated with the envelope. | `"signature"` | String | No |### `DnsRecord` reference
| Field Name | Description | JSON Key | Data Type | Optional |
|-------------|-------------------------------------------------------|---------------|-----------|----------|
| `IpV4` | The IPv4 address (optional). | `"ipv4"` | String | Yes |
| `IpV6` | The IPv6 address (optional). | `"ipv6"` | String | Yes |
| `Host` | The hostname associated with the resolved IP address. | `"host"` | String | No |
| `Timestamp` | The timestamp when the resolution occurred. | `"timestamp"` | Time | No |## Observability
Head over to the [metrics](docs/metrics.md) to see more details.## Changelog
The changelog can be found [here](CHANGELOG.md)