Referencing a specific region via DNS?

There are a couple ways to achieve something close to this:

  • You can reach your instances directly (not going through our proxy) by connecting via wireguard and using <region>.<app>.internal
  • You can use the fly-prefer-region header in your request to ask our proxy to prefer a region when load balancing (this will not affect which edge location you connect to, only where your request goes next)

If you want to test connecting to our edge location, you will need to VPN somewhere close to the region you’re aiming for (but there are no guarantees).

Unfortunately, the way anycast IPs work, we’d need IPs announced only in certain regions. We’re actually working on this, but it wouldn’t be automatic. You’d have to assign an IP in a specific region and then you could use a hostname, similar to what you suggested, to reach your app.

What are you trying to measure?

  • Latency between a user in a specific region and your app: VPN or synthetic tests (datadog, pingdom, grafana, gcp, etc.). The latter are not to be relied on as a real-world representation though, they go through big internet pipes not available for end-users.
  • Latency between your app in a specific region and you: fly-prefer-region header.
  • Latency between your app and anything: flyctl ssh console --select and choose the region you’re interested in. There you can run whatever command.
1 Like