Please Help... Reinstall of Virtualmin after HDD failure

23 posts / 0 new
Last post
#1 Wed, 08/17/2011 - 20:45
VirtualNoob Pro Licensee

Please Help... Reinstall of Virtualmin after HDD failure

Hi all

I've been using Virtualmin for the last 4-5 months with no trouble. It was installed on a clean ubuntu 10.04 install and I used the script with immediate success.

However, my HDD in the server has died and I need to reinstall Virtualmin and Webmin. I have a clean install of ubuntu 10.04 as before and when I run the script I'm getting a few errors before Virtualmin completes - Webmin manages to install but no virtualmin.

I've attached my log file created by virtualmin during the install in the hope that someone might be able to help me.

I have some clients that I desperately need to get back up and running by the morning...

Any advice would be a massive help.

Thanks in advance.

Wed, 08/17/2011 - 21:03
VirtualNoob Pro Licensee


Wed, 08/17/2011 - 20:58

Ah, it looks like Dovecot is failing. That can happen if "hostname -f" doesn't work.

You'll want to make sure that your hostname is an FQDN -- a name in the format "host.domain.tld", which is what hostname -f returns.

My suggestion would be to set your hostname to an FQDN, which you can do with a command like this:

hostname host.domain.tld

After that, run the command "hostname -f" -- does that return the full hostname you just entered?


Wed, 08/17/2011 - 21:06
VirtualNoob Pro Licensee

Hi Eric - it seems that you're spot on. The hostname -f fails and returns simply hostname: Temporary failure in name resolution.

How do I go about fixing that problem?

(apologies for my blank post above by the way. posting my log file into it caused your server to throw a 500 exception error when visiting this page, so I removed the post)

Wed, 08/17/2011 - 21:11

How do I go about fixing that problem?

Hmm, that's what I described in the second half of my post above :-)

In theory, if you follow the instructions above to set your host to a full "FQDN" hostname, that should resolve your issue.

If not, let us know and we can do some more troubleshooting!


Wed, 08/17/2011 - 21:15
VirtualNoob Pro Licensee

Sorry Eric, I didn't explain myself very well.

I ran the command to change my hostname and entered a FQDN. After this I ran the hostname -f command and still it didn't provide my hostname to me - instead it says that there's a temporary failure in name resolution.


Wed, 08/17/2011 - 21:19
VirtualNoob Pro Licensee

Could this be due to BIND not being installed? AFAIK this package is installed along with Virtualmin, but is that the reason that the hostname -f returns an error right now?

Wed, 08/17/2011 - 21:25

Aha! I've apparently forgotten what it takes to fix that particular issue.

What's your server's primary IP address, the one that shows up for the interface "eth0"?

Edit /etc/hosts, and make sure there's an entry there for that primary IP and your server's hostname, it would look like this:

my.primary.ip  host.domain.tld

That should be the only entry in your /etc/hosts file with your servers hostname... if there's another currently in there, you'd probably need to comment it out.


Wed, 08/17/2011 - 21:28

And no, to answer your question, BIND doesn't need to be installed first, it's normal for that to be installed along with the rest of the Virtualmin dependencies.


Wed, 08/17/2011 - 21:37
VirtualNoob Pro Licensee

That doesn't seem to have sorted it out Eric - here's the contents of my hosts file:

#      localhost #(obviously substituted)

# The following lines are desirable for IPv6 capable hosts
#::1     localhost ip6-localhost ip6-loopback
#fe00::0 ip6-localnet
#ff00::0 ip6-mcastprefix
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters

After this I tried the check via hostname -f and got the same error. So I tried again to set my FQDN via hostname and then ran the check again to receive the same error.

Do you have any other ideas for me?


Wed, 08/17/2011 - 21:43

Hrm, there's folks in the past who had that work for them. But apparently that's not the case here :-)

What you'll probably want to do is find a hostname you can use, even if it's just temporarily, that resolves to your IP address.

I didn't think that would be necessary, but I do suspect it'll solve the issue for you here.


Wed, 08/17/2011 - 22:03
VirtualNoob Pro Licensee

I've tried this too Eric. I've had to set an a record on one of my domains with my registrar that points to the server so there will be a propagation period before I can try this again.

Are there any other options I can try in the meantime?

Wed, 08/17/2011 - 22:23

I don't know that this will solve this particular problem, but it may save one down the road... you'd want to have both of these entries in your /etc/hosts file:      localhost #(obviously substituted)

What you don't want is two localhost entries, or two "" entries. But you'd want one entry for each of those.


Wed, 08/17/2011 - 22:29
VirtualNoob Pro Licensee

I'm now getting hostname: Name or service not known when i run hostname -f

Is that a step forwards or backwards? Or just sideways?

When I run the Virtualmin install script, it still asks me to enter FQDN as part of the setup process. I know you probably already know this from what's happening so far, but I though I should let you know anyway.

Anything else we could try?

Wed, 08/17/2011 - 22:32

If you run the command "hostname" without any parameters, do you get "srv1" back?

If so, try editing /etc/resolv.conf, and add this line:


After that, does "hostname -f" work correctly?


Wed, 08/17/2011 - 22:36
VirtualNoob Pro Licensee

That's odd - running hostname with no parameters returns the full

I've tried adding the domain to the resolv.conf file and that made no different either.

Wed, 08/17/2011 - 23:40

Well, it's possible your hostname still isn't resolving via DNS from your server... but I again didn't think that was necessary for "hostname -f" to work. There's a number of issues similar to yours around the Net... I'll link to a few of them, it's possible that while your waiting for your DNS to resolve correctly, maybe you'll see a solution in one of these that fixes the problem you're having :-)

Dovecot-common Install Error bug report:

Dovecot install failed forum post:

Hostname in Ubuntu 10.04:

Thu, 08/18/2011 - 03:16

Getting the FQDN to work properly can be a b*tch. ;)

Basically, for the FQDN resolution to work correctly, three (or four) things need to play together. That's the files /etc/hostname, /etc/hosts, /etc/resolv.conf and your external nameserver (provided by your hoster e.g.).

Let's say your server's hostname is "lyra" and its already established and externally resolvable domain name is "". Let's further say that lyra's IP is, and the nameserver that forwards requests to the outside has the IP (real-life example from my experimental Virtualmin VM).

Then the contents need to be as follows:



/etc/hosts localhost lyra

(Note that I have both the FQDN and the standalone hostname there.)


nameserver domain

After setting these contents, it might be helpful/required to reboot the machine or execute /etc/init.d/networking restart, though usually that's not necessary.

hostname should then reply with "lyra", and hostname -f with "".

If you still have trouble then, you can additionally check the file /etc/nsswitch.conf which tells the system which facilities to consult for resolving various stuff. You should have a line like this there:

hosts: files dns

If it's missing or deviating, edit it to this.

Note that later, as soon as Virtualmin installs BIND, the following line will/must get added to the top of resolv.conf, so that your locally hosted domains resolve directly:

Thu, 08/18/2011 - 03:11
VirtualNoob Pro Licensee

wow, i finally got to the bottom of this and i'm posting here in the hope that it helps someone else at some point...

The EXACT required content of the hosts file is:   srv1.mydomain.tld   srv1  #the 2nd srv1 is important!    srv1.mydomain.tld   #where the IP is that of your server

Massive thanks to Eric for pointing me in the right direction with this. The only additional thing required on top of the instructions above is the hostname which is the 2nd 'srv1' in the1st line of the hosts file.

Thanks again Eric.

Thu, 08/18/2011 - 03:14

You should not assign an FQDN to the localhost IP, nor should the single hostname go to the localhost IP, that's rather unusual. Try it with my suggestion above. :-)

Thu, 08/18/2011 - 03:16
VirtualNoob Pro Licensee

oops, thanks for spotting that - i'll make the change now...

I'm just over the moon that i got the thing to install!


Sun, 10/09/2011 - 06:28

Locutus - I followed the steps in your post and it worked a treat!

I registered on this forum to post a thankyou!

hostname -f now returns the full FQDN!

Mon, 10/10/2011 - 07:26

You're welcome, and glad it works for you! :)