Hi,
I already read https://www.digitalocean.com/community/questions/set-my-droplet-to-be-a-subdomain-of-a-domain-hosted-on-a-different-server but I have more questions.
I have a droplet that I want it to respond to requests made to a subdomain sucha as subdomain.domian.com
domain.com is hosted elsewhere, so name servers are not DO’s, but are the name servers of the hosting provider.
I named the droplet with FQDN, so PTR record exists.
I created the A record at the hosting DNS manager, pointing to droplet IP. That was 21 hours ago. I guess that is enough time for propagation, specially if no name servers were changed.
“# host subdomain.domain.com ns1.digitalocean.com” returns 5 (refused)
I don’t know if a have to add a domain to the droplet even if the name servers are not DO’s. No tutorials or community questions answer this.
So I added the domain to the droplet, and changed the NS records to point to the hosting name servers. Don’t know if this requires propagation time as well. I did this 2 hours ago.
“# host subdomain.domain.com ns1.digitalocean.com” now returns 3 (NXDOMAIN). Same result if using the hosting name servers.
The droplet already has an nginx server running.
I already powered off and on the droplet.
Don’t know what is missing or incorrect.
Please help.
Best Regards.
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!
When adding an A entry, it should look something like:
A sub DROPLET_IP
Once the sub-domain A entry exists, you’d need to setup a proper server block for the sub-domain by either modifying the default server block or creating a new one, then restart NGINX for the changes to take.
The default server block for NGINX can be found here:
/etc/nginx/sites-available/default
Within the above file, you’ll see server_name, which what you’d modify.
server_name sub.domain.com www.sub.domain.com;
You’ll also want to modify root to tell NGINX where to find the files you’re uploading and want to use for the sub-domain.
Beyond that, what else needs to be modified depends on what you’re trying to setup (PHP, NodeJS, Python, etc).
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.