Running NxFilter on a headless Raspberry Pi

NxFilter is the best free solution for a self-hosted DNS server/filter I have found so far. Today I got my Raspberry Pi, so how about running NxFilter on a headless Raspberry Pi in a family’s home network?

Note: This article is based on a Raspberry Pi Model 2B and NxFilter Version 3.5.1. Never versions of either product may behave differently.

Prerequisites

The current Desktop version of Raspbian, the default Debian-based Operating System for the Raspberry Pi already comes with all required packages (Java, unzip, wget)

  1. Install Raspbian on the Raspberry Pi. You can do this also headless, without an attached Keyboard and Screen, for example by following the official guide on how to install an Operating System on an SD card,  or this more generic guide for a fully automated, configured installation.
  2. Enable SSH
  3. Connect to your Raspberry via SSH, using the default (or configured) Username/Password.
  4. Optional: Update Raspbian to the latest version.
  5. Recommended: Change the default password.
  6. If you used the lite version of Raspian, you need to install JAVA.

Installing NxFilter

Note: This guide roughly follows the  the unix installation instructions from the NxFilter manual:

  1. Download the latest version of NxFilter with wget
    wget http://www.nxfilter.org/download/nxfilter-3.5.1.zip
  2. Unzip to the installation folder (requires root-access)
    sudo unzip nxfilter-3.5.1.zip -d /nxfilter
  3. Change to the installation folder
    cd /nxfilter/bin
  4. Make the necessary scripts executable
    sudo chmod +x *.sh

Manual Startup

  1. Run
    sudo ./startup.sh

Automatic Startup at each Raspberry boot

  1. Add the line /nxfilter/bin/startup.sh -d near the end of the file /etc/rc.local
    cd /etc
    sudo nano rc.local
    
  2. After doing so, the end of the file should look something like
    # NxFilter Autostart
    /nxfilter/bin/startup.sh -d
    exit 0
    
  3. Reboot
    sudo reboot

Configuration of NxFilter

  1. Using another machine with a browser, navigate to http://youripaddress/admin Default Username and Password is admin/admin.
  2. Change default password via “Config/Admin”
  3. See the manual for all configuration options.

Author: Marcel

Contact me via marcel@qrys.ch