Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arbal/tailscale-cloudflare-dnssync
Syncs Tailscale host IPs to a cloudflare hosted dns zone
https://github.com/arbal/tailscale-cloudflare-dnssync
Last synced: 3 months ago
JSON representation
Syncs Tailscale host IPs to a cloudflare hosted dns zone
- Host: GitHub
- URL: https://github.com/arbal/tailscale-cloudflare-dnssync
- Owner: arbal
- License: mit
- Fork: true (marc1307/tailscale-cloudflare-dnssync)
- Created: 2021-11-29T02:31:23.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-31T23:49:38.000Z (almost 2 years ago)
- Last Synced: 2024-02-14T21:13:32.371Z (9 months ago)
- Language: Python
- Size: 29.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tailscale-cloudflare-dnssync
Syncs Tailscale host IPs to a cloudflare hosted DNS zone.
Basically works like Magic DNS, but with your domain.
The main benefit for me is the ability to use letsencrypt with certbot + dns challenge## Features
- Adds ipv4 and ipv6 records for all devices
- Removes DNS records for deleted devices
- Updates DNS records after the hostname/alias changes
- Add a pre- and/or postfixes to dns records
- Checks if DNS records is part of tailscale network (100.64.0.0/12 or fd7a:115c:a1e0::/48) before deleting records :P## Run
### Run using docker (using env var)
```shell
docker run --rm -it --env-file ~/git/tailscale-cloudflare-dnssync/env.txt ghcr.io/marc1307/tailscale-cloudflare-dnssync:latest
```
Envfile:
```env
cf-key=
cf-domain=
#cf-sub=
ts-key=
ts-tailnet=
#prefix=
#postfix=
```
tailnet can be found at the top of the tailscale admin page### Run using docker (using secrets)
```yaml
version: "3"secrets:
cf-key:
file: "./cloudflare-key.txt"
ts-key:
file: "./tailscale-key.txt"services:
cloudflare-dns-sync:
image: ghcr.io/marc1307/tailscale-cloudflare-dnssync:latest
environment:
- ts_tailnet=
- cf_domain=example.com
- cf_sub=sub # optional, uses sub domain for dns records
- prefix=ts- # optional, adds prefix to dns records
- postfix=-ts # optional, adds postfix to dns records
secrets:
- cf-key
- ts-key
```### Run native using python
tbd## How to get API Keys
### Cloudflare
1. Login to Cloudflare Dashboard
2. Create API Key at https://dash.cloudflare.com/profile/api-tokens
3. Template: Edit Zone
4. Permissions:
```
Permission | Zone - DNS - edit
Resource | include - specific zone -
```### Tailscale
1. Login to Tailscale website
2. Create API key at: https://login.tailscale.com/admin/settings/authkeys