Search code examples
dnsdigital-oceannetlifynamecheap

How to setup DNS configuration with Netlify and Digital Ocean combined?


I have bought a domain my-domain.com at Namecheap. My goal is to use subdomains of my-domain.com with Digital Ocean and my-domain.com with Netlify. Desired result:

  • my-domain.com redirecting to Netlify
  • subdomain1.my-domain.com redirecting to Digital Ocean
  • subdomain2.my-domain.com redirecting to Digital Ocean

At the moment, my setup with Namecheap is this: Current Namecheap setup

And Digital Ocean: Current Digital Ocean setup

All the DNS setup is very unclear to me, I appreciate any help!

Thank you.


Solution

  • I have never worked with Netlify and Digital Ocean, but just in theory.

    1) You are using Digital Ocean name servers, so you have to edit DNS records there.

    2) Setup A/AAAA record for each subdomain:

    • my-domain.com with Netlify IP
    • www.my-domain.com with Netlify IP
    • subdomain1.my-domain.com with Digital Ocean IP
    • subdomain2.my-domain.com with Digital Ocean IP

    Remove A/AAAA record with Wildcard (*.my-domain.com)

    3) Setup your server to listen for it