From d8de5caa9c605b1793577a9d29ff3bf069cb7852 Mon Sep 17 00:00:00 2001 From: Trenton Holmes <797416+stumpylog@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:45:18 -0700 Subject: [PATCH] Squashed commit of the following: commit a817d827503938101ec62cb728186ea461f3cdfd Author: Trenton Holmes <797416+stumpylog@users.noreply.github.com> Date: Wed Nov 1 09:45:11 2023 -0700 Updates changelog for 0.2.2 commit 95ef326e801f50dbe042e171db04db385f900f65 Merge: 60fad4e 509b5c9 Author: Trenton Holmes <797416+stumpylog@users.noreply.github.com> Date: Wed Nov 1 09:40:40 2023 -0700 Merge remote-tracking branch 'origin/main' into develop commit 60fad4e2255187b8c77d2997f0db506162f29d7f Author: Trenton Holmes Date: Tue Jun 13 08:57:24 2023 -0700 Updates and simplifies the readme, including some basic configuration commit 9a6740167c0798be691a3e92a8daf30c47c570e5 Author: Trenton Holmes Date: Tue Jun 13 08:43:07 2023 -0700 Updates the changelog format --- .dockerignore | 1 + CHANGELOG.md | 17 ++++++++++++++--- README.md | 41 ++++++++++++++++++++++++++++++----------- 3 files changed, 45 insertions(+), 14 deletions(-) diff --git a/.dockerignore b/.dockerignore index 7db20f0..5ab9a94 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,4 @@ docker-compose.yml README.md CHANGELOG.md +LICENSE diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c22f76..f26d31f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,24 @@ # CHANGELOG -## 0.2.0 +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.2.2] - 2023-11-01 + +### Changed + +- Changelog format is now "Keep a Changelog" style +- Updated action versions + +## [0.2.0] - 2023-05-25 - Alpine 3.18 - s6-overlay 3.1.5.0 -## v0.1.0 +## [0.1.0] - Initial image release - Alpine 3.17 - s6-overlay 3.1.4.2 -- dnsmasq 2.87 diff --git a/README.md b/README.md index 16cb340..d4aaa08 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # Tailscale DNS Container -This is a dead simple container designed to solve a problem likely unique to -my own network and configuration. +This is a dead simple container designed containing dnsmasq from +Alpine Linux, designed to run connected to your Tailnet and +provide more control over DNS requests. ## The Problem @@ -12,14 +13,11 @@ providing the DDNS updated DNS record information. So the devices connect direc to the server when inside my network using a 192.168.1.xxx address. This works great when connected locally. -Now, I'm working on getting Tailscale setup and configured for my devices, so -there will not be open ports and no need for the DDNS updater any longer. -Tailscale allows for DNS control, including using a node as a DNS server. -Great! But it doesn't work quite how I want, as my existing DNS server will -return the server IP address in the 192.168.1.xxx for my own domain. - -To use my existing DNS server, I would also need to advertise subnet routes -to allow access to the server, since the DNS rewrite returns an IP not in the Tailnet. +I wanted roughly the same thing to happen when a device is connected via +[Tailscale](https://tailscale.com/). When a device is on the my tailnet, it +receives the server IP address for my domain as being the server's tailnet IP +address. For requests not for my own domain, they are passed upstream to +AdGuard (or any other DNS server). ## The Solution @@ -31,10 +29,31 @@ The end result? A client connected locally will see the local server IP address A client connected via Tailscale sees the Tailscale IP address of the server. No subnet routing required. +## Configuration + +See the example [docker-compose.yml](./docker-compose.yml) for a full example +of setting the container up, alongside a Tailscale image. + +Mount a dnsmasq configuration file into `/etc/dnsmasq.d/`. Set your domain with its +Tailnet IP as the return value. + +Set your preferred upstream DNS for all other requests. This might be a public +resolver like Cloudflare or Google, your own resolver or something else entirely. + +``` +# Add domains which you want to force to an IP address here. +# Set tailnet IP(s) here +address=/myawesomedomain.me/100.x.y.z + +# Add other name servers here, with domain specs if they are for +# non-public domains. +server=1.1.1.1 +``` + ## Technologies This image is built on: -- [Alpine Linux](https://hub.docker.com/_/alpine/) +- [Alpine Linux](https://www.alpinelinux.org/) - [s6-overlay](https://github.com/just-containers/s6-overlay) - [dnsmasq](https://thekelleys.org.uk/dnsmasq/doc.html)