- I have a web app running behind an OPNsense firewall
- That firewall allows all https traffic to api.mailgun.net
- The webapp calls api.mailgun.net but the resolution is different from the firewall one
It seems api.mailgun.net resolves regularly to a different set of IPs. I tried to look for know IPs but could not find anything.
I don't think it's possible to add a rule to your firewall that dynamically checks whether the connection is going to a domain that resolves to this IP.
However, as you already tried, adding every IP they have to the firewall is a solution. To get all possible IPs I'd do:
Or you just need to add a rule that allows all incoming TCP response traffic for connections you make. Assuming all outgoing traffic is allowed anyways.
To do this, add an incoming ACCEPT rule covering the Ephemeral Port Range: