Report this

What is the reason for this report?

How to change a droplet name, and all associated configurations?

Posted on November 28, 2015

I’ve seen other responses to this subject, but I’m still not sure. I bought my droplet with a friend, and since both of us have websites, we didn’t use a droplet/host name of either. we just used a random name (without any domain) for it.

But we are using this to host our websites and applications. Given that, we need email forwarding and SMTP capabilities (not necessarily a full blown SMTP server, but at least a way to forward emails to any domain pointing at the server, and ability to send emails through php’s mail() function without hassle).

I’ve seen tutorials for this and most of them require the droplet/host name’s to be a valid domain name.

Is there any other way to do it? If not, what else do I need to change, appart from renaming the droplet and changing the hostname of the server? Is it that simple? :)

I’m using Ubuntu 14.04.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

$ sudo hostnamectl set-hostname exchange.mydomain.com Use this command to change the name from inside the droplet.

Late to the party, but hopefully still helpful:

I could pinpoint the problem down to this file:

/etc/mailname

which was still having the old entry.

So I edited the file and set the new filename.

Afterwards in SSH I executed:

  1. newaliases (not sure if needed)
  2. sudo service postfix restart
  3. Then executed my custom bash script with mail.

And voila, the mail sent is from the new email address.

Answer also here: https://serverfault.com/a/1008213/371763

I renamed the hostname, but even after a restart the console was showing the old hostname. Didn’t want to spend time figuring it out, since this was new droplet so I clicked rebuild which of course changed it.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.