Skip to content

Instantly share code, notes, and snippets.

@lgreenlee
Last active January 25, 2022 01:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lgreenlee/54c86072fe68b0369999 to your computer and use it in GitHub Desktop.
Save lgreenlee/54c86072fe68b0369999 to your computer and use it in GitHub Desktop.
TinyDNS/DJBDNS systemd service configuration for Ubuntu
[Unit]
Description=A DNS server daemon
Documentation=man:tinydns(8)
Requires=network.target
After=network.target
[Service]
Restart=always
PIDFile=/var/run/tinydns.pid
ExecStart=/etc/tinydns/run
WorkingDirectory=/etc/tinydns
[Install]
WantedBy=multi-user.target
@muelli
Copy link

muelli commented Jan 6, 2017

FWIW: I needed to add a line with Environment="IP=192.168.121.218" "ROOT=/etc/tinydns/root" "UID=tinydns" "GID=tinydns" in the service section.

@kaimast
Copy link

kaimast commented Dec 14, 2017

Needed to do the same thing as muelli when using the binary from the djbdns package in Ubuntu.

@siemer
Copy link

siemer commented Jan 20, 2022

I run the old dbndns Debian package and I have /etc/tinydns/run taking care of IP, ROOT, GID and UID already.

@siemer
Copy link

siemer commented Jan 22, 2022

I mean... I have not seen the run script, but PIDFile is likely wrong. And definitively not needed.

@siemer
Copy link

siemer commented Jan 25, 2022

@muelli Your UID and GID variables are dangerously wrong: tinydns does not complain, but will not drop root privileges. They should be filled with integers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment