|
| 1 | +# Duck DNS |
| 2 | + |
| 3 | +Duckdns is a DNS service that provides you with a domain name you can update to |
| 4 | +match your dynamic IP-address. |
| 5 | + |
| 6 | +This container automates the process to update your duckdns.org IP. |
| 7 | + |
| 8 | +## References |
| 9 | + |
| 10 | +* Register an account, add your subdomain and get your token from |
| 11 | + [http://www.duckdns.org/](http://www.duckdns.org/) |
| 12 | +* based on the linuxserver |
| 13 | + [docker-duckdns](https://github.com/linuxserver/docker-duckdns) container |
| 14 | + |
| 15 | +## Configuration |
| 16 | + |
| 17 | +Create the file `~/IOTstack/docker-compose.override.yml` and place your Duckdns |
| 18 | +token and chosen domain name there: |
| 19 | + |
| 20 | +``` yaml title="docker-compose.override.yml" |
| 21 | +version: '3.6' |
| 22 | +services: |
| 23 | + duckdns: |
| 24 | + environment: |
| 25 | + TOKEN: your-duckdns-token |
| 26 | + SUBDOMAINS: subdomain |
| 27 | +``` |
| 28 | +
|
| 29 | +Observe that at least the initial update is successful: |
| 30 | +
|
| 31 | +``` console |
| 32 | +$ cd ~/IOTstack |
| 33 | +$ docker-compose up -d duckdns |
| 34 | +$ docker-compose logs duckdns |
| 35 | +...SNIP... |
| 36 | +Retrieving subdomain and token from the environment variables |
| 37 | +log will be output to docker log |
| 38 | +Your IP was updated at Wed May 4 03:31:14 UTC 2022 |
| 39 | +...SNIP... |
| 40 | +``` |
| 41 | + |
| 42 | +If there is a problem, check that the resulting effective configuration of |
| 43 | +'duckdns:' looks OK: |
| 44 | +``` console |
| 45 | +$ cd ~/IOTstack && docker-compose config |
| 46 | +``` |
| 47 | + |
| 48 | +### Domain name for the private IP |
| 49 | + |
| 50 | +!!! note inline end "Example IP:s and domains" |
| 51 | + |
| 52 | + ``` mermaid |
| 53 | + flowchart |
| 54 | + I([Internet]) |
| 55 | + G("Router\npublic IP: 52.85.51.71\nsubdomain.duckdns.org") |
| 56 | + R(Raspberry pi\nprivate IP: 192.168.0.100\nprivate_subdomain.duckdns.org) |
| 57 | + I --- G --- |LAN| R |
| 58 | + ``` |
| 59 | + |
| 60 | +As a public DNS server, Duckdns is not meant to be used for private IPs. It's |
| 61 | +recommended that for resolving internal LAN IPs you use the [Pi |
| 62 | +Hole](Pi-hole.md) container. |
| 63 | + |
| 64 | +That said, it's possible to update Duckdns with to your LAN IP. This may be |
| 65 | +convenient if you have devices that don't support mDNS (.local) and don't want |
| 66 | +to run Pi-hole. This is especially useful if you can't assign a static IP to |
| 67 | +your RPi. Add a `PRIVATE_SUBDOMAIN` variable indicating your subdomain for |
| 68 | +this: |
| 69 | + |
| 70 | +``` yaml title="added variable to docker-compose.override.yml" |
| 71 | +version: '3.6' |
| 72 | +services: |
| 73 | + duckdns: |
| 74 | + environment: |
| 75 | + TOKEN: ... |
| 76 | + SUBDOMAINS: ... |
| 77 | + PRIVATE_SUBDOMAIN: private_subdomain |
| 78 | +``` |
0 commit comments