Netlify App with custom domain and different endpoints

Hello,
I have created a page for me and my friends for a small soccer betting game.
For this I have additionally built a nodeJs api, through which I can request the required data from my RaspberryPi. I can reach this Api over the ports 80 and 443 from the internet.
Now I bought a domain at strato.de (e.g. mybetgame.online) and I want my netlifyproject to be reachable from this site.
So I have deposited this domain at netlify and have entered the 4 entries for the nameservers that netlify provides at strato.
Now I want my api to be reachable via api.mybetgame.online. This is not possible via Strato, because I can not store an A-record or AAAA-record, once I have entered the nameservers.
How do my settings at Netlify look like, so that I can reach the project in Netlify via mybetgame.online and my RaspberryPi via api.mybetgame.online (I use ddclient on the Raspi to update the A-Record or the AAAA-Record if necessary)?

Translated with DeepL Translate: The world's most accurate translator (free version)

So, for mybetgame.online and www.mybetgame.online, Netlify should have directly put a NETLIFY record on your DNS settings.

If you enabled IPv6, you should see a NETLIFYv6 record as well. Both should looks like this:

Now, for the api.mybetgame.online endpoint, it will be harder, since I’m assuming your Raspberry-Pi IP address is dynamic. If that is the case, you may need to use some application like GitHub - oscartbeaumont/netlify-dynamic-dns: A Dynamic DNS Client For Netlify Managed DNS which will call the Netlify API to update the DNS record.

I have personally never tried so, but I remember hearing from someone that it works well.

Hi, @bleumi85. Our support team can help you to created the DNS records at Netlify. If you tell us what DNS records you want to make, we can help you to create them.

What isn’t covered by the scope of our support is making the RaspberryPi accessible from the public internet and determining what IP address it is using.

To restate that for clarity:

  • The Netlify support team can help you make the DNS records.
  • The Netlify support team can not tell you what the correct DNS records are.

In most cases, you will need to make an A or AAAA type record. What I cannot tell you is what the correct IP address to enter is.

If you tell us the IP address, we can help you create the DNS record if there are questions about how to do so.

Hi luke,
This was really helpful and I’m almost done. As @hartanto mentioned the IP of my raspberry pi is dynamic so I have to update it everytime it changes. I can do this via ddclient or via a cron job on my raspberry pi. There’s just one little problem. I tried to use the NetlifyAPI for this. This works perfectly for adding an A or AAAA record. But of course there are more and more entries everytime I add a new one, so I want to delete the “old” record when I add a new one. I use this URL to show all the records for my site: https://api.netlify.com/api/v1/sites//dns I can see NETLIFY and the NETLIFYv6 entries but the API response doesn’t show the A or AAAA record I created, although it’s there and works when I look at the homepage. Any ideas?!

Hey @bleumi85,

I don’t see any domain named mybetgame.online on Netlify. Are you sure that’s the correct one?