Changing Server name

Well, I am finally getting around to setting up my server VM Pro. Unfortunately, when I first installed it, I inadvertently gave it the name of a domain I want to host. I am assuming that the name appears in more locations than just the HOSTS file, so can anyone tell me the correct way to change the server name throughout VM completely?

Thorndike

Hrm… I don’t think the server name ends up being hard coded much at all – there’s probably not too much you’ll end up needing to change.

I think most programs obtain the name in a manner similar to running the “hostname” command, which polls /etc/hostname. So you’ll definitely want to update that (I’m pretty sure that’s what’s updated when you log into Virtualmin, then go into Webmin -> Networking -> Network Configuration -> Hostname and DNS Client).

Aside from that, I suspect you won’t need to change much.

But, you certainly don’t want to risk any issues down the road, I might do a quick grep through the config files and verify that.

If your hostname is “coffee” (just to pick a random name that I’m enjoying at the moment :wink: – you could run this command:

find /etc | xargs grep coffee 2>/dev/null | less

However, that’ll get ugly if your hostname is too similar to other words in your configs :slight_smile:
-Eric