Hello, I wanted to ask how rDNS (reverse DNS) exactly works in Digital Ocean, it’s unclear to me how simply naming my droplet to an FQDN would automatically handle the PTR record(s), what if I used an already existing or non-existing FQDN? What if I named my droplet “google.com”? What if I named it “abcxyz.org” (assuming such domain doesn’t exist)?
In other words, how is rDNS technically/internally set up for DO droplets?
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.
Hello all
Hello all
Changing PTR
DigitalOcean automatically configures the reverse dns entry (PTR) on their end. It will be the hostname you choose when you set up your droplet. You can change/check this in the control panel by selecting your droplet, then settings, then rename. As it says, changing the name there will update the PTR but not the hostname of the system, that is something you will need to do, instructions for that vary depending on the system you have installed.
To set one, you need to enter your Droplet via SSH and:
Change the hostname using hostnamectl
The first step once you have entered the droplet would be to use the
hostnamectl
command. Let’s say we want to name our droplet ‘ExampleName’. To do so, we need to execute the command like soThe hostnamectl command does not produce output. On success, 0 is returned, a non-zero failure code otherwise.
Update the /etc/hosts file
Next on our list would be to update the hosts file located in the etc folder. You can use any editor you want from nano, vi, vim.
In there you’ll see something similar to
Change the line which says the following
to be
Save the file and exit.
That should be it.
Hope this helps!
Hello, @ElicWilly
The Reverse DNS is configured automatically from our end based on the droplet’s hostname.
In case you choose a hostname which is already in use or something like google.com the hostname will simply not work for you in way to access/connect your droplet via the hostname and you will need to use the IP address in order to login via ssh or access it in the browser.
Hope this helps.
Regards, Alex