Need to fix “Virtualmin System is not setup to use itself as a DNS server” error? We can help you.
Virtualmin has the ability to manage your domain’s DNS when properly configured. However, it is optional to use use the domain registrar or third-party services like CloudFlare to host our DNS.
Here at Bobcares, we handle requests from our customers to fix “system is not setup to use itself as a DNS” error as a part of our Server Management Services. Today we will see how our Support Engineers fix this for our customers who use Virtualmin.
How to fix “Virtualmin System is not setup to use itself as a DNS server” error
At times while trying to enable Nginx modules in the Features and Plugins after running Virtualmin post-installation wizard we may end up with the following:
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 127.0.0.1 to the list of DNS servers, or turn off the BIND feature on the module config page.
Here we are taking an Ubuntu 16.04 hosted in DigitalOcean as an example.
This error is caused by DHCP. DigitalOcean uses DHCP to assign IP addresses to droplets. Furthermore, while obtaining the IP address for the server DHCP server uses the DNS servers provided by DigitalOcean instead of what’s currently set up on the server.
Therefore we cannot add 127.0.0.1 simply to the list of DNS servers as it will get overwritten.
However, we can fix this by adding 127.0.0.1 to the /etc/resolv.conf (list of DNS Servers) file from the command line.
We must keep in mind that it gets overwritten on each server boot-up. So we need to add 127.0.0.1 to the /etc/resolv.conf file on each boot-up.
Steps to follow:
1. We will use /etc/rc.local to add a code that adds 127.0.0.1 to the /etc/resolv.conf file on each boot-up.
2. So open /etc/rc.local file from the command line as a root user.
We can use the following command:
3. Now paste the following file before the line that reads exit 0
echo nameserver 127.0.0.1 >> /etc/resolv.conf
File should look like the following after the change:
4. Finally, we will save rc.local file with the change and reboot the server.
We can use the following command for the reboot:
[Need assistance? We can help you]
In short, we saw how our Support Techs fix “Virtualmin System is not setup to use itself as a DNS server” error for our customers.