Should /etc/hosts have the IP and domain name I want to use with the vps?

June 4, 2016 416 views
Getting Started

Should /etc/hosts have the IP and domain name I want to use with the vps?
Running Debian 8.4.

1 Answer

If your intention is to be able to resolve your IP address from anywhere on the web, then the procedure is usually to create DNS entries using the DO control panel, and then configuring with your domain registrar to point to the DO DNS servers.
For the first part try this basic DO DNS tutorial. For the second part, there is an older tutorial on setting up with external registrars that may still apply.

by Etel Sverdlov
This article walks you through setting up the DNS for your site. The tutorial includes steps to set up an A records, point your nameservers, and provides some information about MX records.
  • Ok, thanks. So I have added the DigitalOcean Domain Servers IP's to my domain registrars account for the domain and I have entered the domain name in the DigitalOcean's Networking area. A record has @ and VPS IP address, CNAME www and domain name. Is that right?
    Do I need to set a host name in the A record?
    I have the VPS IP address, but I'm wondering if there is also a VPS name?
    For example at OVH you get the IP address and a VPS host something like vpshostname.vps.ovh.ca.

    • It might take a while (could be up to several hours) for your DNS entries to propagate, but you can try entering your domain name at mxtoolbox.com to see if it can resolve to your digitalocean IP address, i.e., your A record in your DNS. There is also a pull down menu item there where you can check all of your DNS records.

      • Looks like I can ssh by using the domain name as well as using the IP address.

Have another answer? Share your knowledge.