Friday, November 17, 2017

Running Technitium DNS Server on Ubuntu Linux

Technitium DNS Server is build to be cross platform using the .NET Standard 2.0. You can run the DNS Server Portable App on Linux or macOS by using .NET Core 2.2. This post is written for Ubuntu Linux but, you can easily follow similar steps on your favorite distro.

This blog post is updated regularly to provide latest instructions to install the DNS Server. So, refer it when you are about to do a fresh installation.

Using Automated Installer / Updater

Automated installer script can be used to install or update the DNS Server. Automated installer script is available for following distros:

  • Ubuntu Server
    curl -sSL | sudo bash
  • Raspbian (Stretch) for Raspberry Pi
    curl -sSL | sudo bash

Installing DNS Server Manually

Install the latest .NET Core runtime from here. Start Terminal and follow the steps below to run DNS Server on Ubuntu:

  1. Download DNS Server portable app using wget and extract it.
    sudo mkdir -p /etc/dns/
    sudo tar -zxf DnsServerPortable.tar.gz -C /etc/dns/
  2. You can now run the DNS Server directly from console as a standalone app.
    cd /etc/dns/
    sudo ./
  3. Or, if your distro uses systemd, follow these steps to install it as a daemon.
    sudo cp /etc/dns/systemd.service /etc/systemd/system/dns.service
    sudo systemctl enable dns.service
    sudo systemctl start dns.service

    You may want to check the systemd log entries to find issue if the daemon fails to start:

    journalctl --unit dns --follow

  4. Or, if your distro does not support systemd, follow these steps to run it as a daemon using supervisor.
    sudo apt-get -y install supervisor
    sudo cp /etc/dns/supervisor.conf /etc/supervisor/conf.d/dns.conf
    sudo service supervisor restart

    You may want to check the log file to find issue if the daemon fails to start:

    cat /var/log/dns.err.log

  5. Open the url http://localhost:5380/ to access the web console.

Common Issue With Ubuntu

If you are using Ubuntu Desktop, you may find dnsmasq or systemd-resolved daemon already running on UDP port 53 preventing the DNS Server to listen on the same port. You can check the DNS Server log file from the web console to confirm the issue by finding this error:

[2019-01-01 07:30:59 UTC] [] System.Net.Sockets.SocketException (98): Address already in use
   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at DnsServerCore.DnsServer.Start() in Z:\Technitium\Projects\DnsServer\DnsServerCore\DnsServer.cs:line 811

You may confirm if its dnsmasq or systemd-resolved by running sudo netstat -nlpu command.

Follow these steps below to disable the dnsmasq service:

  1. Edit the NetworkManager.conf file to disable dnsmasq service:
    sudo nano /etc/NetworkManager/NetworkManager.conf
    Comment out the dns=dnsmasq line by adding # character at the beginning like this #dns=dnsmasq and exit the editor by pressing CTRL+X and enter y to save the file.
  2. Restart the computer to apply changes as shown below:
    sudo reboot now
  3. After system reboot, open Terminal and check DNS Server logs again from the web console.

Follow these steps below to disable the systemd-resolved service:

  1. Disable the systemd-resolved service and stop it:
    sudo systemctl disable systemd-resolved
    sudo systemctl stop systemd-resolved
  2. Edit your /etc/resolv.conf using nano:
    sudo nano /etc/resolv.conf
    Edit the existing nameserver entry to the one shown below in your /etc/resolv.conf
  3. Edit your /etc/NetworkManager/NetworkManager.conf using nano:
    sudo nano /etc/NetworkManager/NetworkManager.conf
    Put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf as shown below:
  4. Restart network-manager:
    sudo service network-manager restart
  5. Now restart the DNS Server and check logs again from the web console.
    sudo systemctl restart dns.service

That's it!

The DNS Server is running and you can configure your network with the IP address of this computer for DNS resolution.

Check out the web console to create zone, check cached zones, access DNS client tool and configure server settings.

The DNS Server creates a folder named config in the current folder which contains the server config and zone files. Make sure you copy this folder while moving the DNS server folder if you want all the zone files and config to persist.

For any related queries, feel free to comment on this post.


  1. Hello my loved one! I wish to say that this post is amazing, nice written and come
    with approximately all significant infos. I would like to look
    more posts like this .

  2. I have a problem regarding to hosting a hotspot with spoofed MAC address. None of my devices can connect to my hotspot unless I revert the MAC address back to original. Is there anyways to be able to host a hotspot with spoofed MAC Address?

    1. Send email to with screenshots and details like OS version mobile device type etc.

  3. I have a problem regarding to hosting a hotspot with spoofed MAC address. None of my devices can connect to my hotspot unless I revert the MAC address back to original. Is there anyways to be able to host a hotspot with spoofed MAC Address?

  4. Replies
    1. You can do that as mentioned here:

      I will be working on making an bash script that will automate and run the app as a daemon.

    2. I have updated this post with instructions to run the DNS server as a daemon.

  5. I have used this program for some time on my company's server for client computers. I'm finding it very good, fast and besides it's safe!!! Many thanks for being free!!!

  6. How do I uninstall Technitium?

    1. It depends on your installation. If you have systemd then just disable & stop the dns.service. If you are using supervisord, then delete the /etc/supervisor/conf.d/dns.conf file and restart supervisord. After that, you can delete the /etc/dns/ directory to complete the uninstallation.

    2. Sorry, I was not clear. I am a Noob and I installed on my Raspberry Pi using the following: curl -sSL | sudo bash.
      Is there a way to run a "reverse" install to remove all that has been installed?

    3. 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/


  7. Hi, I installed the tutorial, but when I'm running on the network, it's slowing down, or sometimes I have to restart the ubuntu server that is running DNS TECHNITIUM, have any suggestions to help me.

    1. Thanks for the feedback. Please send details like the config of the server and exact details of the issue to Is the server slowing down with high CPU usage or is the DNS Server not responding in time? How many users are using the DNS Server? Do send any screenshots too if necessary for clarity.

  8. how to show in browser this program

    1. Once the DNS Server is running, just confirm if the port 5380 is running using netstat -nlpt command. Make sure that you add the port 5380 to firewall, if any. Use the server's IP address and the port to connect to the web console from your laptop.

  9. On a freshly installed and fully updated Raspbian Lite Stretch (28-11-2013 version) system I get at web gui login: Error! parsererror - SyntaxError: Unexpected token < in JSON at position 4.

    1. Thanks for the feedback. Please email me more details like the web browser version and screenshots to