Tuesday, January 1, 2019

Turn Raspberry Pi Into Network Wide DNS Server

Turn your Raspberry Pi into a network wide DNS server for security, privacy and blocking Internet Ads on your private network!

Raspberry Pi 3 Model B+

With Technitium DNS Server version 2.2 release, it is now possible to run it on Raspberry Pi (Raspbian Stretch) using .NET Core and we have a single line automatic installer ready to make it easy to get it running.

Install DNS Server

Just connect to your Raspberry Pi using SSH and run the command below to install the DNS server:

curl -sSL https://download.technitium.com/dns/install.sh | sudo bash

You can install the software manually too if you do not wish to directly run the install script. You will need to first manually install .NET Core on your Raspberry Pi and then use these steps to install the DNS Server.

Once the installation is complete, open the DNS Server web console to view the dashboard and customize the settings.

Technitium DNS Server web console on Raspberry Pi 3 Model B+

Configure Your Router

To use it as a network wide DNS server, you need to configure your network router's DHCP settings and add your Raspberry Pi's IP address as a custom DNS server. You may also need to configure the WAN settings to override the default ISP provided DNS servers with your Raspberry Pi one. Check your router's manual for the configuration details.

Do make sure that your Raspberry Pi has a static IP address so that it does not change later causing issues with failed domain resolutions on the entire network. Also make sure to install heat sinks for your Raspberry Pi to prevent overheating issues since you will be running it round the clock.

If you have any queries or feedback, do comment below to let me know. You can also email your queries to support@technitium.com.

22 comments:

  1. Well, this is pi-hole's competitor that you should give a try!

    ReplyDelete
  2. dotnet core is brilliant for this.

    ReplyDelete
  3. Got everything running fine now and prefer it way over Pi-Hole so far. Would it be possible to create an option that would automatically add a reverse dns record (if the reverse zone exists)?

    ReplyDelete
    Replies
    1. Automatic reverse zone option is only possible if there is DHCP server included, which is a planned feature that would get added in coming months. Right now, you can add a reverse zone manually. You can find a default reverse zone already there '1.0.0.127.in-addr.arpa' and try to create a zone for your local network manually. If you enter an IP address and try to add zone then the server automatically created a reverse zone for that particular IP address.

      Delete
  4. Thank you for this... I've just found you so I look forward to trying this out.

    ReplyDelete
  5. Hi, thanks for this. Any news on further updates? I really like this product.

    ReplyDelete
    Replies
    1. You can track updates and issues on GitHub. More features are being built for next release.

      Delete
  6. pi-hole doesn't work on windows natively, this does. I prefer this.

    ReplyDelete
  7. Would have loved to have this as a Docker Image; the few I found did not have a Raspberry Pi version :(

    ReplyDelete
  8. I just found this app, great, and there are serious DNS spoofing/contamination in China. With this app, it is easier to get real/accurate dns results.

    I used Acrylic DNS Proxy before, which is also very good, but I feel occasionally unstable.

    Thanks for your Great Work!

    ReplyDelete
    Replies
    1. Thanks for the compliments. Do let me know if you have any feedback or feature requests.

      Delete
  9. I've just started using this for ad blocking and it's working great - amazing software!
    However, SABNZBD which used to listen on 127.0.0.1:8080 for its web interface no longer works - do I need to reconfigure sabnzbd or can I add some kind of exception within Technitium DNS server for it?
    Thanks!

    ReplyDelete
    Replies
    1. Since your existing software is running on port 8080 and the DNS Server runs on port 5380, there is no conflict and both should run along. I would suggest that you run netstat -nlpt | grep ":8080" command and check if any other software is using port 8080. If you are still unable to debug then send me an email at support@technitium.com with more details and output of the netstat -nlptu command.

      Delete
    2. I had other strange things happening so I removed/reinstalled your software and it now seems to be a lot happier and everything is working as planned - thanks for your quick reply.
      Again, thank you for your excellent work - this piece of software is pretty damn amazing!

      Delete
  10. How do you remove this off a RaspberryPi? I've decided it's not required but cant work out the package that needs removing.

    ReplyDelete
    Replies
    1. Just run the following commands to remove it from raspberry pi:

      # stop and disable the dns daemon
      sudo systemctl disable dns.service
      sudo systemctl stop dns.service
      # delete dns server files
      sudo rm -rf /etc/dns/

      # remove dotnet
      sudo rm /usr/bin/dotnet
      sudo rm -rf /opt/dotnet/

      Delete
  11. On RPi 1 Model B, i've got this error:

    ● dns.service - Technitium DNS Service
    Loaded: loaded (/etc/systemd/system/dns.service; enabled; vendor preset: enab
    Active: activating (auto-restart) (Result: signal) since Wed 2020-06-17 17:50
    Process: 1287 ExecStart=/usr/bin/dotnet /etc/dns/DnsServerApp.dll (code=killed
    Main PID: 1287 (code=killed, signal=SEGV)

    ReplyDelete
    Replies
    1. Thanks for the feedback. It could be due to less RAM available on the device. Good news is that next version is about to be released by this weekend which uses way less RAM than the current version. So, do try the new release on the device and see how it works.

      Delete
  12. Unable to install on Raspberry Pi.
    Error screenshot is posted here: https://ibb.co/pxFMf0p

    ReplyDelete
    Replies
    1. Thanks for the comment. The installer script URL has been changed recently. I have updated this post with the latest URL. Do try and let me know if there is any issue.

      Delete