By rickeeey
I’m running my Rails application on an Ubuntu 18.04 server. I purchased a domain for my server and I’m able to reach my website on this domain without problems - so my droplet configuration worked perfectly.
Now I want to change my Capistrano-Config to use the domain instead of the IP-address for deployment, but I can’t SSH on the VPS by using the domain name.
So if I try: ssh deploy@ip-address it works, but if I do ssh deploy@example.de I get the connection error: ssh: connect to host example.de port 22: Connection timed out
Shouldn’t the DNS-Server map my domain name to the IP-address? I read in some threads that I should edit the /etc/hosts file, but some others say it’s not good practice.
What am I missing? I’m relatively new to this topic, so maybe someone can give me a good hint?
Thanks in advance!
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!
Hello, @rickeeey
In order to ssh to your droplet using a domain name or hostname in short you need to make sure that the domain is pointed/resolving from the server itself.
You can check if the current hostname is resolving/pointed to your droplet. You can also point any domain name to your droplet and use this as hostname when trying to ssh. It will work for you same as using the IP address.
If you want to access your server easily instead of typing or trying to find the droplet IP address, you can simply create an alias on your local machine as well.
Hope this helps.
Regards, Alex
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.