How to fix “System is not setup to use itself as a DNS server” error on Virtualmin

Virtualmin has the ability to manage your domain’s DNS when properly configured. But it’s optional, you can use your domain registrar or third party services like CloudFlare to host your DNS. In any case, there a bug on some Ubuntu systems that prevent Virtualmin from mapping domains inside your VPS. This post intend help you fix it for good.

So I was setting up a new server for a client with Ubuntu 16.04, Virtualmin and Nginx. Server’s DNS was managed by DigitalOcean itself. But where DNS is hosted does not play a part in this case. I tried to enable Nginx modules in the Features and Plugins after running Virtualmin post-installation wizard. But it failed with following error.

Failed to save enabled features : Virtualmin is configured to setup DNS zones, but this system is not setup to use itself as a DNS server. Either add to the list of DNS servers, or turn off the BIND feature on the module config page.

As you can see, Virtualmin gives possible solutions along with the error. This can be easily fixed by adding to the list of DNS Servers. But unfortunately that doesn’t work. Changes you make to the list of DNS servers does not get saved. It won’t even give you an error message.

The other solution Virtualmin suggest is to disable DNS server. That won’t work for me since Virtualmin will then fail to serve domains from it’s home directory and serve pages from Ubuntu’s default html directory. This will result in an Apache default page on your domain although you have NGINX installed.

This error is caused by DHCP. DigitalOcean uses DHCP to assign IP addresses to droplets. And while obtaining the IP address for your server, DNS servers provided by DigitalOcean are used by DHCP server instead of what’s currently setup on your server. This is the reason why you couldn’t add to the list of DNS Servers. It gets overwritten.

I could fix this by adding to the /etc/resolv.conf (list of DNS Servers) file from command line. But it gets overwritten on each server boot-up. What if I can add to the /etc/resolv.conf file on each boot-up? that’s exactly how I’m going to fix this. You can use /etc/rc.local to add peace of code that adds to the /etc/resolv.conf file on each boot-up. So open your /etc/rc.local file from command line. You need to be root user to do this.

nano /etc/rc.local

No /etc/rc.local file?

Now paste following file before the line that reads exit 0

echo nameserver >> /etc/resolv.conf

File should look like this after the change,
Screenshot of Ubuntu 16.04 /etc/rc.local file

Save rc.local file with the change and reboot the server,


Error should be fixed now.


Hey!! I'm Tharindu. I'm from Sri Lanka. I'm a part time freelancer and this is my blog where I write about everything I think might be useful to readers. If you read a tutorial here and want to hire me, contact me here.

Related Articles


  1. This worked like a charm, thanks! My configuration was pretty much the same: Virtualmin on Ubuntu 16.04 but all hosted in AWS.
    And I did have my DNS pointed to my own domain providers so I guess I could have also disabled BIND DNS module, right?

  2. Ahh, as in looking for a needle in a haystack and, I found it right here. The needle that is. Thank you indeed for making this resource available – this together with the rc.local file fix.
    I have Webmin/Virtualmin atop Ubuntu 18.04 LTS. This fixed up the Virtualmin issue.
    For others and, depending on reference/tut sources, here’s a pointer to another common Virtualmin setup issue – referring to specifically to MySQL issues –
    Thanks again

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button