Skip to content

Instantly share code, notes, and snippets.

@tjarksaul
Forked from lgreenlee/tinydns.service
Last active January 29, 2022 09:41
Show Gist options
  • Save tjarksaul/7b4fe9121097a4686bd0dd1a7e44460d to your computer and use it in GitHub Desktop.
Save tjarksaul/7b4fe9121097a4686bd0dd1a7e44460d to your computer and use it in GitHub Desktop.
TinyDNS/DJBDNS setup for Ubuntu/Debian
#!/bin/bash -e
apt install -y ucspi-tcp build-essential
wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz
tar xf djbdns-1.05.tar.gz
cd djbdns-1.05/
echo gcc -O2 -include /usr/include/errno.h > conf-cc
wget https://www.fefe.de/dns/djbdns-1.05-test28.diff.xz
xz -d djbdns-1.05-test28.diff.xz
patch -p1 < djbdns-1.05-test28.diff
make
make setup check
useradd --no-create-home --shell /bin/false Gtinydns
useradd --no-create-home --shell /bin/false Gdnslog
tinydns-conf Gtinydns Gdnslog ./tinydns 127.0.0.1
mv ./tinydns/root /etc/tinydns
[Unit]
Description=A DNS server daemon
Documentation=man:tinydns(8)
Requires=network.target
After=network.target
[Service]
Restart=always
PIDFile=/var/run/tinydns.pid
Environment="IP=ADDR" "ROOT=/etc/tinydns" "UID=Gtinydns" "GID=Gtinydns"
ExecStart=/usr/local/bin/tinydns
WorkingDirectory=/etc/tinydns
[Install]
WantedBy=multi-user.target
@siemer
Copy link

siemer commented Jan 29, 2022

Do you remember were you forked this from? I commented on the original which problems the service file has...

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