Updated documentation

Fixed github language detection
This commit is contained in:
Maximilian Kratz 2021-04-13 17:14:18 +02:00
parent 41a72d4806
commit 7b5828e907
2 changed files with 16 additions and 7 deletions

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
*.com linguist-detectable=false
*.dyn linguist-detectable=false

View file

@ -9,15 +9,19 @@ Keep in mind that this is kind of a blueprint and not necessary production-ready
CoreDNS is able to reread configuration and zone files on changes.
This project provides a quite simple way to update such a zone file via a [webhook](https://github.com/adnanh/webhook).
Most *decent* routers allow to specify a custom URL with basic auth to send IP updates to.
The webhook provides such a URL and triggers a bash script that updates the dynamic zone file and boom - your dynamic IP updates are done.
The webhook provides such a URL and triggers a sh script that updates the dynamic zone file and boom - your dynamic IP updates are done.
**In short (step-by-step):**
1. Client receives a new dynamic IP address.
1. Client sends a [cURL](https://curl.se/) query to the webhook container containing the new IP address.
1. Webhook container triggers the bash script.
1. Bash script updates the CoreDNS zone file -> Includes the new IP address.
1. Webhook container triggers the sh script.
1. Sh script updates the CoreDNS zone file -> Includes the new IP address and updates serial.
1. CoreDNS automatically reloads the zone file and serves the new IP address.
**Please notice:**
The sh script checks if the provided parameter is a valid IPv4 address using a regex.
Currently, the updating of IPv6 addresses is **not** supported.
## Configuration
@ -25,11 +29,12 @@ For the example configuration a [Docker-Compose](https://docs.docker.com/compose
Feel free to adapt the needed steps to e.g. a native installation (with binaries) (although Docker-Compose is running just fine for my personal setup).
- Adapt [htpasswd](./config/dynamic) to your needs. You need at least one valid entry with a username:password combination. The file is prefilled with the credential `example:0123456789` - Do not forget to change/remove that!
- This file will be used by an nginx container to provide basic authentification.
- Adapt [db.example.com](./config/zones/example.com/db.example.com) to match your root domain zone. In most cases, you already have such a file and can change the needed parameters in that. The needed parameters are already prefilled in the example file:
- Three nameserver records for the root zone `example.com` -> These values will not change at all.
- Three nameserver records for the dynamic zone `dyn.example.com` -> This is the zone that will be updated by web hooks. The records deligate all queries from DNS clients to the CoreDNS server specified for this zone. (It then will handle all DNS queries for the dynamic zone.)
- Three nameserver records for the root zone `example.com` --> These values will not change at all.
- Three nameserver records for the dynamic zone `dyn.example.com` --> This is the zone that will be updated by web hooks. The records deligate all queries from DNS clients to the CoreDNS server specified for this zone. (It then will handle all DNS queries for the dynamic zone.)
- In this example, the root zone will also be served by your CoreDNS server. Keep in mind that this is absolutely not neccessary! You just have to deligate the dynamic zone.
- Use [db.example.com.dyn](./config/zones/example.com/db.example.com.dyn) to create the dynamic zone. This file will get updated via the bash script.
- Use [db.example.com.dyn](./config/zones/example.com/db.example.com.dyn) to create the dynamic zone. This file will get updated via the sh script.
- Please notice: At least, you have to change all occurences of `example.com` to your own domain in all config/zone files!
After you've adapted the configuration files to your needs, start the Docker-Compose stack:
@ -41,7 +46,9 @@ For an easy to use reverse proxy for Docker containers, check out [nginx-proxy](
### OPNsense client example
In your [OPNsense](https://opnsense.org/) box go to *Services* -> *Dynamic DNS* and click on *(+) Add*.
This example can easily be used to update a dynamic zone with your [OPNsense](https://opnsense.org/) router.
In your OPNsense box go to *Services* -> *Dynamic DNS* and click on *(+) Add*.
Configure the following settings:
| Field | Value | Explanation |