Question

How to setup domain and sub-domain to different hosting providers

Hello,

Current situation:

My domain: www.example.com which is with ‘BigRock’, which has nameservers connection to the ‘HostGator’. Now, I want to point www.blog.example.com sub-domain to ‘DigitalOcean’.

Expected output:

example.com (BigRock) ----> HostGator blog.example.com (BigRock) ----> DigitalOcean

In order to achieve this, following are the steps I have taken but it still doesn’t seem to be working as expected. I already waited for 48 hours after making these changes.

  1. [In BigRock] Created the A record with the destination IP address of DigitalOcean droplet.
  2. [DigitalOcean] Assigned the domain (sub-domain actually) to the DigitalOcean droplet (it has the A record inside it too).
  3. [HostGator] Created (with Add a Domain option) a sub-domain inside HostGator (primary hosting connected via nameservers) which has A record that points to DigitalOcean.
  4. [DigitalOcean] Since blog.example.com is a wordpress website, I changed the URLs inside it in the database.

I think step 1 and 2 are necessary, I’m not sure about step 3.

Can someone help me here please? I might not have provided all the necessary details so please feel free to ask any follow-up question. Thank you.


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.

alexdo
Site Moderator
Site Moderator badge
July 8, 2020
Accepted Answer

Hello, @suchakmaulik179

If your domain name is using Hostgator’s nameservers than all DNS changes need to be made from their control panel, because the active DNS zone is there. If you made DNS changes for your domain name from other control panel such as BigRock, the DNS changes will not take effect.

You can simply create an A record for blog.example.com and point it to the IP address of your droplet with DigitalOcean.

Hope that helps!

Regards, Alex

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel
Get started for free

Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

New accounts only. By submitting your email you agree to our Privacy Policy.

© 2023 DigitalOcean, LLC.