Question

Setup subdomain from Bluehost on Digital Ocean droplet.

This has been asked many times before, I know, I’ve read lots articles on DO and other sources all saying very much the same thing, but can’t seem to find the issue.

I have a couple of subdomains my client has hosted on Bluehost with the zone file setup correctly. All works well. But now I want to host 2 of the subdomains on my DO droplet instead.

I have successfully added full domains and subdomains on two of my DO droplets following all the directions in the past without issue. The difference is this time the main domain name is hosted on Bluehost with their name servers and the subdomains are to be hosted on DO. The subdomain has been added to the zone file on Bluehost and it works, but when I change the A record to point to my DO droplet IP and then setup a new domain in DO and a simple A record pointing to the droplet IP, my default domain website always shows up when I load the site in my browser. I’ve also added CNAMES and tried other things.

I’ve got the sites added to sites-available and sites-enabled and the conf files were copied from other working sites with the paths changed. The paths exist and files are there. I’ve used sudo a2ensite and restarted apache. I have pinged the subdomain and it points to my DO IP address.

Access/Error logs say nothing.

Using Ubuntu 14.04/Apache.

Why would my default site keep showing up instead?

Is there an issue with name servers?

What have I missed that other articles aren’t saying?


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

You should create a separate virtual host configuration file for your new domain on DO droplet. Having a DNS A record (or CNAME for that mater) pointing to your droplet is not enough, as Apache must know how to process the domain. If it does not find a matching configuration file, it will redirect (or use the config of) the default site (e.g., 000-default.conf).