Efficient way to change server hostname

Hello,

I am not a real newbie because I use VirtualMin for years but this time I feel like one : I try to efficiently change the “system hostname” of my server (the one you type during installation; at least using the “install.sh” file). I think it’s used by a lot of place in VirtualMin/WebMin so I was thinking there is probably a place to change it globally but I can’t found it … neither through the search feature of VirutalMin nor through one forum topic.

Thanks in advance.

Tristan

you can do over ssh and type at the prompt: hostname something.domain.tld

or webmin - networking - Network Configuration - Hostname and DNS Client and use the field: Hostname

Ronald, thanks for your reply.

I was aware of this command but wasn’t sure I just needed to execute it :wink: without modifying other config files. But sometimes it’s better to be sure :slight_smile:

Edit : Afterwards, I noticed the PostFix mail server had some troubles processing incomming mails (https://www.virtualmin.com/node/10656). It’s related to the hostname change: you have to update the “/etc/postfix/main.cf” file => “myhostname” line should contains your new hostname and “mydestination” one should contains both your new hostanme and “localhost”.

Tristan