Post installation wizzard (Ubuntu-20 LEMP)

Hi,

I need help installing virtualmin correctly. The install script has no errors. If I run the post installation wizzard it has no errors to. But if I reboot my server I can not access virtualmin or ssh into it.

After reboot I can access only via VNC and if run “virtualmin check-config” I get the following error:

ERROR: Virtualmin could not work out the default IPv4 address for virtual servers on your system. You will need to update either the network interface for virtual addresses or default virtual server IP address fields on the module configuration page.

I guess it is something with the nameserver or hostname… need a guide or a hint to solve the problem.
Pretty new to servers and linux. :stuck_out_tongue:

If it’s a VPS, it might be that the hypervisor your host uses assigns the server’s IP address(es) using DHCP with IP address reservation(s). That would cause /etc/resolv.conf to be overwritten on every boot.

Check /etc/resolv.conf and see if it has a line nameserver 127.0.0.1 in addition to the upstream resolver entries. If not, then add the line and restart BIND and Webmin. If that fixes the problem, reboot the server and check /etc/resolv.conf again. If the line is gone, then that’s what happening.

The fix in that case would be to re-add the line and make the file immutable by executing

chattr +i /etc/resolv.conf

as root. That will make the file unchangeable, even by root. If you ever do need to edit it (for example, if the upstream resolvers change), then you’ll have to execute

chattr -i /etc/resolv.conf

If you have more than one IP address, using DHCP to assign them might also result in the IP address(es) other than the primary one losing their interface associations on reboot. If, for example, you use a second IP for NS2, or for mail, then the service associated with that IP would be unavailable after a reboot. The IP might or might not respond to a ping, but the service would not.

In other words, if you have NS2 on the impossible IP4 of 999.999.999.999, then

ping 999.999.999.999

might or might not be successful, but

ping NS2.example.tld

definitely would not.

In that event, the interface assignment for the additional IP address(es) would also have to be re-created at boot, using any of a number of inelegant methods that would depend on the underlying OS.

Richard

2 Likes

Your problems are likely DNS and Richard’s advice spells it out really well. The only thing I would add is to turn off any kind of “network helper” tool in the VPS control panel if there is one. These dynamic networking tools are fine unless you’re hosting your own DNS and need a static configuration.

Also watch out for Network Manager changing resolvers. I’m barely familiar with how Debian or Ubuntu does it, but by default, Network Manager with CentOS will re-write /etc/resolv.conf whenever DNS entries are in the network interface file. I actually prefer it that way as long as the interface says DNS1 = 127.0.0.1. Just edit the interface, restart Network Manager, then inspect /etc/resolv.conf for reassurance and no need to make it permanent.

1 Like

Thanks for your help!!
Yes, it is a VPS… and I have got only one IP.

Thats in the /etc/resolv.conf:

  • 127.0.0.53
  • options edns0

But I guess, it is not so complicated, just miss configure the post installation of virtualmin.
I will post some screenshots of the setup, where I do not know what to do.

I am not sure what to do here… it is prefilled with my Full Qualified Domain Name from Contabo. Or shall I enter the name server from contabo?

ns1.contabo.net (79.143.182.242, 2a02:c205:0:0882::1)
ns2.contabo.net (178.238.234.231, 2a02:c205:0:0891::1)
ns3.contabo.net (5.189.191.29, 2a02:c207:0:0842::1)

At the first screenshot I have tried it with the “Full Qualified Domain Name” and “with the checked box” also.

Here is the second screenshot, where I do not know, what do do:
At the second i have tried both of “no”

Thanks for your help!!

Sorry, I do not know where the issue happens. I have updated/edited may post.

It is a fresh install of virtualmin. After I have finished the installation wizzard with no erros and I do a reboot then I can not access the server anymore.

It is hard to explain and my english is not the best. :slight_smile:

Why are there no upstream resolver entries in /etc/resolv.conf ?

Basically, there should be upstream resolvers that your server uses to resolve domain names, which typically are in the form

nameserver xxx.xxx.xxx.xxx

(IPv6 will also work.)

You would also be running BIND, which is a DNS server running on your server. You can name the primary nameserver whatever you like as long as it’s resolvable, which basically means that you went to your registrar and registered the nameserver.

It’s pretty common to use “ns1.example.tld” as a nameserver name, but that’s just common, not mandatory. Virtualmin uses the server’s full hostname by default, which is also fine. So would “barney.example.tld” or “matilda.example.tld” as long as the names are properly registered with the registrar for the domain.

I suggest you add entries for the three nameservers you provided to /etc/resolv.conf in format

nameserver 79.143.182.242
nameserver 178.238.234.231
nameserver 5.189.191.29

I also suggest that you create you own BIND nameserver as “ns.yourdomain.tld” to distinguish it from the machine’s hostname (just to make things clearer for you when diagosing DNS issues: it makes no practical difference what the nameserver is named), and register the nameserver name you created with your registrar to make it resolvable. Then use that in the “Primary nameserver” field.

By the way, I’m no Ubuntu expert; so if someone smarter than me says “NO, don’t listen to that idiot!” by all means defer to the smarter person. I think this sort of thing is pretty uniform across distros, but I don’t know that for sure.

Richard

EDIT: Also, obviously, make sure that any sites hosted on the server have their authoritative nameservers set to whatever nameserver name you choose in their registrars.

Same issue!!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.