Either add 127.0.0.1 to the list of DNS servers

On one of my servers I keep getting a message saying: "Virtualmin's configuration has not been checked since it was last updated. Click the button below to verify it now." When I click the button I get the following message: "The status of your system is being checked to ensure that all enabled features are available, that the mail server is properly configured, and that quotas are active .. 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. It appears that DHCP is being used to dynamically configure your network interfaces, which can cause the DNS servers to be set based on settings provided by the DHCP server. Using a static IP address is strongly recommended with Virtualmin."

I have tried adding 127.0.0.1 to the list of DNS servers, but each time I do it it appears to be set, after I apply and go back and check, it has disappeared and I still get the error message.

Status: 
Active

Comments

This can happen if your system's IP address is being dynamically assigned, such as by DHCP .. which isn't really recommended for a web hosting system.

The work-around is to edit /etc/dhclient-eth0.conf and add the lines :

supersede domain-name-servers 127.0.0.1;

You may need to reboot to apply this change.

Thanks, but actually this server has a fixed IP address, so maybe I could turn off DHCP instead?

If you have a fixed IP, then you generally aren't using DHCP ...

If you go to Webmin -> Networking -> Network Configuration -> Network Interfaces -> Activated at boot, what is in the "IPv4 address" column for eth0 ?

My column is entitled "IP address" and for Eth0 it says "From DHCP"

I am "happy" that another user encountered the same problem. I had to add this entry many times already :-)

venet0 OpenVZ 127.0.0.1 255.255.255.255 Yes venet0:0 OpenVZ (Virtualmin) static ip address 1 255.255.255.255 Yes venet0:1 OpenVZ (Virtual) static ip address 2 255.255.255.255 Yes

As you can see it doesn't seem to DHCP related

PS centos 55 / vm 383

martynw - are you running on a virtual machine, or a real system?

Snapmin, the problem generally comes up anytime something causes the nameservers in /etc/resolv.conf to be overwritten.

In 99% of the cases, that's due to DHCP.

You appear to be the other 1% :-)

If you really aren't using DHCP, my suspicion is that your provider is overwriting your resolv.conf file with a fresh one anytime you reboot. You may want to discuss that with them.

Alternatively, you could always add this code to /etc/rc.local:

echo nameserver 127.0.0.1 >> /etc/resolv.conf

Which should append that to your resolv.conf file each time your server boots up.

I think that is the explanation :-) thanks.

Jamie,

My server runs on Linode. I suppose it is a 'virtual server' but Linode have proprietary programs to enable users to manage their 'Linode' as if it were its own machine, i.e. it has its own IP address, I can reboot it, install an operating system, restore a backup etc all independent of other people's 'Linodes' on the same machine.

Regards, Martyn

Another option is to disable Virtualmin's check for 127.0.0.1 in resolv.conf , which can be done at System Settings -> Virtualmin Configuration -> Advanced options -> Check resolv.conf for this system?.

The only downside to not having 127.0.0.1 in your resolvers file is that your system may not be able to lookup a newly created domain that has not been registered in DNS yet, which could cause local mail delivery to that domain to fail.

Was experiencing the same issue on Debian 9 .

There is no longer a rc.local file

I found a guide that helped

Firstly add this line

nameserver 127.0.0.1

to /etc/resolv.conf - than run this command

chattr +i /etc/resolv.conf 

to make the file resolv.conf immutable (will no longer be able to be overwritten on boot)

Hope this helps

On Debian 9, there is no real resolv.conf file anymore. Instead you should add 127.0.0.1 at Webmin -> Networking -> Network Configuration -> Hostname and DNS Client.

On my install I just started working on the DNS for about the same reason, this is what I learned: - You should keep the Cloudmin DNS for a master, then use Webmin's Cluster Slaves to create secondaries on your Virtualmin installs.. that way when you update the Cloudmin zone the changes are going to be made available to the Virtualmin zones as well.

Note that changes happening to the Virtualmin zones are not going to be visible to your Cloudmin - unless you set up a third DNS, Cluster Slave your Cloudmin and Virtualmin zones to that third one, and point your entire infrastructure to it.

I suspect this is how I got my DNS working and not relying on 127.0.0.1.. I have a 4-node Cloudmin cluster and my Virtualmins are setup to read / write Cluster Slaves instead of relying on the isolated localhost. I am also working on my employer's intranet with a non-valid TLZ (.local) and a private network (10.0/23) so until I got the DNS all straightened out nothing worked as expected.

Adding that my Cloudmin is on the DMZ of a router so the DNS must be fully functional as the IP network is going to change once the cloud is moved into production..