How to change a server's hostname: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 20: | Line 20: | ||
preserve_hostname: true | preserve_hostname: true | ||
</pre> | </pre> | ||
== Postfix == | |||
* update <code>/etc/mailname</code> | |||
* update <code>/etc/postfix/main.cf</code> | |||
* restart postfix |
Latest revision as of 18:00, 28 January 2019
Update the following files:
- /etc/hosts
- /etc/hostname
Ubuntu 18.04
See current hostname and related info:
hostnamectl
Change hostname:
hostnamectl set-hostname my_new_hostname
Update /etc/hosts
if necessary.
If cloud-init
is installed, edit /etc/cloud/cloud.cfg
preserve_hostname: true
Postfix
- update
/etc/mailname
- update
/etc/postfix/main.cf
- restart postfix