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”.