DNS setup: can I add A record for IPv4 if it is public (shared)?

I am not sure on the exact implications on having the ingress IPv4 as public (shared). Does this mean it can change?
With the IPv6 it is simple; I added a AAAA record to my DNS pointing api.example.com to the IPv6 address of my app (as listed by fly ip list)
However, I am not sure how to proceed with the IPv4. Should I just add a A record pointing to it?

Thanks for your help! I am new to all this


Yep, you are correct: you simply add an A record in your DNS pointed at that IPv4. That way you will have both an A record and an AAAA record.

No, the IPv4 won’t change. Being shared just means it is shared with other apps. That is better value for Fly and hence a shared IPv4 can be free.

The recommended approach is to use the shared IPv4 unless you need a dedicated one (which makes sense as you might as well avoid that extra fee unless you really need to be paying it). Whether you need a dedicated one depends on your usage. Check out this linked paragraph for the reasons why you might need a dedicated one and see if any apply. Generally they won’t:

This was very helpful, thank you!
So with the IPv4 being shared, I am assuming fly has some internal way to route requests to the appropriate VM? This way a user can have confidence that a request doesn’t make its way to some other VM


No problem.

That’s right: they use the domain to decide which app to route a request to. Each app will have a unique domain.

If it’s a concern you can have a dedicated IPv4, even if you don’t actually need one. You just have to pay a monthly fee for it. It’s up to you.

1 Like

From what I understand there is no way to have a static egress IP. This is a bit of a problem for users connecting to databases that specify network access by IP (For example I am using MongoDB)
Having said that, MongoDB does allow ranges of IP’s to be whitelisted; is there a range of egress IP’s that fly reliably uses? If so, I can improve DB security by restricting access to the range of egress IP’s fly uses.

@seb97 Correct, that’s not currently supported.

There are several threads about that e.g

This thread has some suggested ways to get an IP (if you scroll down). I haven’t tried any of them so I don’t know if they actually work:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.