How to get a domain to work with multiple different web hosting services?

I have a single domain mydomain.example. I have sudo privileges on the servers.

Currently, I have my domain being hosted at Netlify.com

So mydomain.example and www.mydomain.example go to my frontend webapp.

How can I get the subdomain api.mydomain.example to go to my Digital Ocean (DO) server and *.mydomain.example to redirect to the same location of mydomain.example?

My domain is registered under GoDaddy (GD) and I have set up the nameservers to point to Netlify. Would I also need to add DO’s nameservers to GD to get the subdomain I want?

My current DNS records for Netlify are

mydomain.example     3600  IN   NETLIFY     my-project-123.netlify.com
www.mydomain.example 3600  IN   NETLIFY     my-project-123.netlify.com
mydomain.example     3600  IN   NETLIFYv6   my-project-123.netlify.com
www.mydomain.example 3600  IN   NETLIFYv6   my-project-123.netlify.com

I have tried making an A record in Netlify to get api.mydomain.example to point to the server’s IP address but always get “site can not be reached”.

Hi @cdrandin,

Can you share the real domains you are working with so that we can check to see how they are setup? Also note that in order to setup a wildcard subdomain you’ll need to have the site under a paid team. You can still have a single subdomain point to another service by adding the appropriate DNS record though.