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.
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.
Click below to sign up and get $100 of credit to try our products over 60 days!
Maybe the user interface has changed since this question was answered in November. This is how I changed the droplet name:
Voila!
$ sudo hostnamectl set-hostname exchange.mydomain.com Use this command to change the name from inside the droplet.
Today (2017) the interface enabling direct name change: at the page of your Cloud Panel (cloud.digitalocean.com/droplets…), simply click on the current name of the Droplet, and you will then be able to input whatever name you choose. Thanks @MikeG.
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.
Will renaming a droplet impact my website? I have a website that is hosted on a droplet…I’m not that technical.
@fgarci03
To change the name of a Droplet, you’ll need to login to the DigitalOcean Control Panel, click on the name of your Droplet and then navigate to
Settings -> Rename
. This will rename your Droplet in the system and generate a valid PTR based on the hostname you provide.Ideally, you want to set the name to something such as:
Where
host
is what you want to name the server andyourdomain.ext
is your domain name. You’d then want to login to the CLI and update the hostname on the server. To do that you’d run:and hit enter.
You’ll also want to add an
A
entry for your hostname to your DNS Zone file.Where
DROPLET_IP
= your Droplet’s public IP address. Note, you don’t need the full domain in theA
entry. Just substitutehost
above with whatever you wish to name your server.Late to the party, but hopefully still helpful:
I could pinpoint the problem down to this file:
which was still having the old entry.
So I edited the file and set the new filename.
Afterwards in SSH I executed:
newaliases
(not sure if needed)sudo service postfix restart
And voila, the mail sent is from the new email address.
Answer also here: https://serverfault.com/a/1008213/371763