Sub-domain from a different host pointed to droplet

Posted July 14, 2015 7.6k views

Hi there,
I have found several related questions, but none of them help me much to solve my problem with pointing a sub-domain to Digital Ocean.


  • I have a domain name hosted with a hosting company:;
  • I want to have a sub-domain ( pointed to my droplet in ways when a user access, the browser shows my droplet content, instead of the hosting service content, without showing my IP address on the browser address bar.

My questions:

  • I read that I have to change A records for the subdomain to point to droplet IP. Is this done on the Hosting Company Control Panel?
  • Since it is only a sub-domain (not a domain name), do I require to setup anything on DNS settings for my account on Digital Ocean?
  • My web service is already working on Digital Ocean droplet on a specific port. When I access my droplet IP address:port, I can see the content I want. Since I am using nginx, do I have to do anything on xginx configuration in order to make this to point to this ip address:port?

The idea is to allow user to browse the droplet content, without seeing the IP address of the droplet. They should only see

Hope anyone can help me

Thank you in advance



  • Just a small comment
    “The idea is to allow user to browse the droplet content, without seeing the IP address of the droplet. They should only see”
    Domains are only there to give the users of a specific service the ease of using a domain to “connect” to it instead of the IP. I don’t know if you meant this, but you can not hide your IP or something. With a small ping, its found ;)

  • Thank you CryptDesigns,
    Yes, I do know that but, If I made myself missunderstood, what I meant to say is, that I want to allow users to browse the droplet content (web page or app inside of it), without having to remember the droplet IP adress. The idea is to hide the IP adress whille user is surfing the web site. As an exact example, when you’re surfing digital ocean web site, you always see the dns on the browser address bar and not the IP.

    Thank you once again for your time



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
2 answers

You will need to log into your other hosting company’s control panel and access your DNS settings for this domain. There you will add an A record pointing the subdomain to your droplet’s IP address. You do not need to do anything in the DigitalOcean DNS section since your domain itself is not delegated to our DNS servers.

If your web service is running on a port other than 80(http) or 443(https) you will want to adjust nginx to listen on port 80 (or 443 if you have an SSL certificate installed). A DNS record cannot generally be used to specify a port, only an IP address.

  1. Add an A record in your domains host, pointing to droplet’s ip.
  2. Look this tutorial. If ur sub domain is, then you will also need a /etc/nginx/sites-available/ beside the IP.

This is how it worked for me.

by Mateusz Papiernik
Laravel is one of the most popular open-source web application frameworks written in PHP. It aims to help developers build both simple and complex applications by making frequently-used application tasks (like caching and authentication) easier. In this tutorial, we will deploy a simple Laravel application with a production environment in mind.