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

Posted June 4, 2016 4.7k views
Getting Started

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

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.

Submit an Answer
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 Josh Barnett
by Kathleen Juell
DNS is the naming system that is used to bind a domain name to a web server. In this guide, we will change the nameservers for a domain that we have registered and point it to a DigitalOcean Droplet.
  • 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

    • 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 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.