Skip to content

Install Dns Safety on Ubuntu 18.04 LTS

The following steps show how to install DnsSafety filter on 64-bit Ubuntu 18.04 LTS. It is recommended to download installation scripts mentioned on each step from our GitHub repository (sub folder scripts.ubuntu18). Just run them one by one as root. Please note, build for Ubuntu 18.04 LTS is experimental and not supported in production deployments.

Step 1. Update

It is recommended to update the system prior to installation. Run bash 01_update.sh in the console.

#!/bin/bash

# update should be done as root
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

# add universe repo
add-apt-repository universe

# update, upgrade and reboot
apt update && apt -y upgrade && reboot

Step 2. Install

Run bash 02_dnssafety.sh in the console to install the latest stable version of Dns Safety. Note the /opt/dnssafety/bin/dsdnsd daemon runs as standard daemon user in Linux.

#!/bin/bash

# all packages are installed as root
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

# default arc
MAJOR="0.14.0"
MINOR="7D5A"
ARCH="amd64"

# download
wget http://packages.diladele.com/dnssafety/$MAJOR.$MINOR/$ARCH/release/ubuntu18/dnssafety-$MAJOR.${MINOR}_$ARCH.deb

# install
dpkg --install dnssafety-$MAJOR.${MINOR}_$ARCH.deb

# relabel folder
chown -R daemon:daemon /opt/dnssafety

Step 3. Integrate

Finally, to integrate Dns Safety filter with the system run bash 03_integrate.sh.

#!/bin/bash

# all packages are installed as root
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

# disable and remove systemd resolver
systemctl disable systemd-resolved
systemctl stop systemd-resolved

# resolv.conf is a link under systemd resolver
ls -lh /etc/resolv.conf 

# remove it
rm /etc/resolv.conf

# recreate default one
echo "nameserver 127.0.0.1" > /etc/resolv.conf

# restart dns safety dns server
systemctl restart dsdnsd
systemctl status dsdnsd

# wait for the dns resolve to come up
sleep 10

# test it works nicely
dig welcome.dnssafety.io @127.0.0.1

Reboot your server now to see that everything comes back to life correctly after it. After that continue to installation of Admin UI as indicated in the Admin UI installation page (installation instructions for Admin UI are the same for Debian 10 and Ubuntu 18).