This commit is contained in:
Mateusz Gruszczyński committed 2026-11-22 14:50:16 +01:00
1 parent fa432bebda
commit b796a6685e
15 files changed
+390 -153

No files matched your search

+52 -9
View File
@@ -1,9 +1,33 @@
# Deployment
## After installing the .deb package
## Installing from repo.linuxiarz.pl
Signed packages for Debian/Ubuntu, RHEL/Alma/Rocky and SUSE (amd64) are built from
https://git.linuxiarz.pl/gru/EasyDNS and published on https://repo.linuxiarz.pl.
```bash
# Debian / Ubuntu
curl -fsSL https://repo.linuxiarz.pl/repo-key.gpg | sudo gpg --dearmor --yes -o /usr/share/keyrings/linuxiarz.gpg
echo "deb [signed-by=/usr/share/keyrings/linuxiarz.gpg] https://repo.linuxiarz.pl/apt stable main" \
| sudo tee /etc/apt/sources.list.d/linuxiarz.list
sudo apt update && sudo apt install easydns
# RHEL / Alma / Rocky
sudo rpm --import https://repo.linuxiarz.pl/repo-key.gpg
sudo curl -fsSL -o /etc/yum.repos.d/linuxiarz.repo https://repo.linuxiarz.pl/linuxiarz.repo
sudo dnf install easydns
# SUSE / openSUSE
sudo rpm --import https://repo.linuxiarz.pl/repo-key.gpg
sudo zypper addrepo --refresh --gpgcheck https://repo.linuxiarz.pl/suse/x86_64/ linuxiarz
sudo zypper install easydns
```
## After installing the package
The service is not started automatically (port 53 is often in use, see below).
```bash
sudo apt install ./dist/easydns_0.1.0-1_amd64.deb
sudo easydns zone create example.com --ns ns1.example.com=192.0.2.10 --ip 192.0.2.80
sudo systemctl enable --now easydns
sudo easydns status # no key to generate or pass
@@ -12,20 +36,38 @@ easydig @127.0.0.1 example.com SOA +short
The package installs the default hybrid configuration (`/etc/easydns/config.yaml`:
`0.0.0.0:53` + `[::1]:53`, recursion for `192.168.0.0/16`, `10.0.0.0/8`, `127.0.0.1`),
creates `/etc/easydns/{zones.d,keys.d,data/zones}` and the `easydns` user. Layout:
[configuration.md](configuration.md#default-installation-layout). On hosts where
systemd-resolved occupies `127.0.0.53:53` there is no conflict (different address); if
another DNS server listens on `0.0.0.0:53`, stop it or change `server.listen`.
[configuration.md](configuration.md#default-installation-layout). Example configurations
are in `/usr/share/doc/easydns/examples/`.
### Port 53 and systemd-resolved
The default `0.0.0.0:53` cannot be bound while another service holds any address on port 53 –
including the `127.0.0.53:53` stub of systemd-resolved (Ubuntu, Fedora, some Debian
installs); the server then stops with `Address already in use`. Either turn the stub off and
let the host use EasyDNS:
```bash
sudo install -d /etc/systemd/resolved.conf.d
printf '[Resolve]\nDNSStubListener=no\nDNS=127.0.0.1\n' | sudo tee /etc/systemd/resolved.conf.d/easydns.conf
sudo systemctl restart systemd-resolved
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
```
or list concrete addresses in `server.listen` (for example `["192.0.2.53:53", "127.0.0.1:53"]`),
which do not collide with `127.0.0.53`. dnsmasq, BIND or Unbound on port 53 must be stopped
or moved the same way. Check what holds the port: `sudo ss -lntup 'sport = :53'`.
## Upgrading the package (keeping your configuration)
```bash
sudo tar czf /root/easydns-backup-$(date +%F).tgz /etc/easydns # config, zones, keys, data
scripts/build-deb.sh # → dist/easydns_<ver>_<arch>.deb
sudo apt install -o Dpkg::Options::=--force-confold ./dist/easydns_*_amd64.deb
sudo apt update && sudo apt install -o Dpkg::Options::=--force-confold easydns
# RHEL: sudo dnf upgrade easydns SUSE: sudo zypper update easydns
```
* `/etc/easydns/config.yaml` and `root.hints` are conffiles: `--force-confold` keeps your
version without asking; the new default is saved next to it as `config.yaml.dpkg-dist`
(without the option dpkg asks – answer **N** to keep yours).
(without the option dpkg asks – answer **N** to keep yours). RPM keeps a modified file and
writes the new default as `config.yaml.rpmnew`.
* Files in `zones.d/`, `keys.d/` and `data/` are never touched by the package.
* A running server is restarted only if the new version accepts the configuration
(`easydns check-config` as the `easydns` user); otherwise the old version keeps
@@ -63,8 +105,9 @@ and keep `/etc/easydns/data` on a volume. Multi-arch:
9090 metrics on loopback by default. Do not expose the API, metrics or recursion to the
Internet without explicit ACLs and TLS (reverse proxy).
## Packages and archives
## Building packages yourself
The official packages come from repo.linuxiarz.pl (see above). To build locally:
`scripts/build-deb.sh [--arch amd64,arm64] [--debian bookworm] [--revision N] [--test]` builds
`dist/easydns_<version>-<rev>_<arch>.deb` entirely inside Docker (`deploy/docker/Dockerfile.deb`,
control/maintainer scripts in `deploy/packaging/debian/`); `--test` installs the package in a