2024-10-14 12:06:12 +00:00
|
|
|
# dyndnsd
|
2019-09-17 23:51:33 +00:00
|
|
|
|
2021-05-23 13:22:21 +00:00
|
|
|
This is a simple daemon that runs in the background and checks for your public
|
|
|
|
IP regularily. If it changes, the service sets the corresponding DNS record. The
|
|
|
|
service supports both IPv4 and IPv6 addresses.
|
2019-09-18 00:23:07 +00:00
|
|
|
|
2021-05-23 13:22:21 +00:00
|
|
|
## Installation
|
2019-09-17 23:51:33 +00:00
|
|
|
|
2021-05-23 13:22:21 +00:00
|
|
|
Use the package manager [cargo](https://doc.rust-lang.org/cargo/) to install
|
2024-10-14 12:06:12 +00:00
|
|
|
dyndnsd.
|
2019-09-18 08:15:11 +00:00
|
|
|
|
2021-05-23 13:22:21 +00:00
|
|
|
```bash
|
2024-10-14 12:06:12 +00:00
|
|
|
cargo install dyndnsd
|
2019-09-18 08:25:48 +00:00
|
|
|
```
|
|
|
|
|
2021-05-23 13:22:21 +00:00
|
|
|
## Usage
|
2019-09-23 09:03:00 +00:00
|
|
|
### Config
|
|
|
|
|
2024-10-14 12:06:12 +00:00
|
|
|
`dyndnsd` expects to find a config file at `/etc/dyndnsd/config.toml`.
|
2021-05-23 13:22:21 +00:00
|
|
|
|
2024-10-14 11:52:52 +00:00
|
|
|
As you can see from the path, the configuration should be a toml file. A sample
|
2021-05-23 13:22:21 +00:00
|
|
|
could look like this:
|
2019-09-23 09:03:00 +00:00
|
|
|
|
2024-10-14 11:52:52 +00:00
|
|
|
```toml
|
|
|
|
zone = "example.com"
|
|
|
|
domain = "example.example.com"
|
|
|
|
ipv4 = true # defaults to true
|
|
|
|
ipv6 = true # defaults to false
|
|
|
|
interval = 15 # seconds, defaults to 60
|
2024-10-14 12:06:12 +00:00
|
|
|
|
|
|
|
# You can use cloudflare
|
|
|
|
[dns_provider_config.cloudflare]
|
|
|
|
secret = "secretkey"
|
|
|
|
|
|
|
|
# Or you can use RFC 2136 with TSIG
|
|
|
|
[dns_provider_config.rfc2136]
|
|
|
|
addr = "udp://1.2.3.4:53"
|
|
|
|
key_name = "test"
|
|
|
|
key = "test"
|
|
|
|
algorithm = "hmac-sha256"
|
2019-09-23 09:03:00 +00:00
|
|
|
```
|
|
|
|
|
2021-05-23 13:22:21 +00:00
|
|
|
As you can see, we have a token here. This token needs to have access to at
|
|
|
|
least:
|
|
|
|
- reading you account zones (for getting the zone ID from the zone name)
|
|
|
|
- reading and writing to the DNS zone (for first fetching the records and then
|
|
|
|
modifying them.
|
|
|
|
|
|
|
|
Aside of the token, you also have to prepare some DNS records before running
|
|
|
|
this: If you enabled IPv4 support, there needs to be a DNS `A` record for the
|
|
|
|
configured domain already, and if you enabled IPv6 support, you need a DNS
|
|
|
|
`AAAA` record set on the configured domain. The service will not create new
|
|
|
|
records, it just modifies existing records.
|
|
|
|
|
|
|
|
### Running
|
|
|
|
|
|
|
|
To run the service, just call the binary. You can optionally set the `RUST_LOG`
|
|
|
|
env var to configure the log level:
|
|
|
|
|
|
|
|
```bash
|
2024-10-14 12:06:12 +00:00
|
|
|
RUST_LOG=info dyndnsd
|
2021-05-23 13:22:21 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Contributing
|
|
|
|
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
|
|
|
|
|
|
|
|
Please make sure to update tests as appropriate.
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
2024-10-14 12:06:12 +00:00
|
|
|
dyndnsd is cooperative non-violent software: you can use,
|
2023-01-01 22:03:13 +00:00
|
|
|
redistribute, and/or modify it under the terms of the CNPLv7+ as found in the
|
|
|
|
`LICENSE.md` file in the source code root directory or at
|
|
|
|
<https://git.pixie.town/thufie/npl-builder>.
|
2019-09-18 08:25:48 +00:00
|
|
|
|
2024-10-14 12:06:12 +00:00
|
|
|
dyndnsd comes with ABSOLUTELY NO WARRANTY, to the extent
|
2023-01-01 22:03:13 +00:00
|
|
|
permitted by applicable law. See `LICENSE.md` for details.
|
2019-09-18 08:25:48 +00:00
|
|
|
|
2023-01-01 22:03:13 +00:00
|
|
|
[CNPLv7+](https://thufie.lain.haus/NPL.html)
|
2019-09-18 08:25:48 +00:00
|
|
|
|
2021-05-23 13:22:21 +00:00
|
|
|
## Attribution
|
2019-09-18 08:25:48 +00:00
|
|
|
|
2021-05-23 13:22:21 +00:00
|
|
|
This work is derived from
|
|
|
|
[cloudflare-ddns](https://github.com/zbrox/cloudflare-ddns), a commandline
|
|
|
|
utility fullfilling the same purpose. It's written by Rostislav Raykov
|
|
|
|
<z@zbrox.org> and available under the MIT license at the link above.
|
2019-09-18 08:25:48 +00:00
|
|
|
|
2024-10-14 12:06:12 +00:00
|
|
|
This fork has made major changes to the project, to the extent where most of
|
|
|
|
the code has been rewritten and the tool is quite different:
|
|
|
|
- Runs as a service instead of in a cron job
|
|
|
|
- Supports IPv6
|
|
|
|
- Homegrown Cloudflare API client has been replaced with a library which
|
|
|
|
supports multiple providers
|