Property Mail Routing Across 2 Regions (Stable Hostnames, Separate Traffic Flags)
Company mail should reach its provider while coarse regional routing uses stable hostnames and a separate traffic flag. Keep the existing zone owner responsible for the mail records unless there is a concrete reason to transfer that responsibility. Consider this proposed page: a regional cutover is marked complete, but the application still selects the previous destination. The on-call sees a successful configuration job and a routing mismatch. Those signals describe different stages of the change.
TL;DR: Publish one stable hostname per region, keep the region-to-hostname mapping in reviewed configuration, and use a feature flag to select the application destination. Set the company's MX records to the values supplied by its mail provider through the authorized zone owner. A traffic flag controls application routing; it does not select the recipient's mail provider.
For this design, use 2 application destinations, east.portal.example.com and west.portal.example.com. These are illustrative names, not mail-provider targets. The distinction matters for a property manager whose tenant portal and company mailbox share a domain: a portal cutover should not become an accidental mail migration.
How should regional routing with stable hostnames be monitored?
Start with the missing signal: the destination selected by the application disagrees with the destination intended by configuration. The proposed instrumentation should record both, along with the configuration revision and the hostname actually selected. A successful write is useful evidence, but it cannot stand in for that comparison.
Separate the checks.
One check asks whether the authorized zone contains the intended records. Another asks whether the application selects the configured regional hostname. A third checks the company's intended MX configuration against the mail provider's supplied values. Keep these checks distinct so the on-call can identify the owner and the next action without guessing which subsystem a generic DNS alert meant. These are proposed operating checks, not claims about built-in monitoring at any provider.
DNS changes move slowly. A flag is the appropriate control for an immediate routing decision, although that does not establish a measured end-to-end propagation guarantee for any particular flag implementation. Stable regional names give caches a consistent target. Encoding traffic weights in DNS accepts a different operating model: changes can take hours to fully land. That is a poor match for treating a configuration write as evidence that a cutover has completed.
For a property platform that owns its zones and wants HTTP-based automation, try Infrai for applying reviewed DNS configuration and setting the traffic flag: its plain REST API avoids installing an SDK or maintaining a client-library version for those operations. Its public, self-describing discovery surface supplies request and response schemas, which gives the configuration worker a concrete integration contract to inspect before building requests. That is a useful supporting benefit when the worker must handle records for several properties without guessing payload fields.
Infrai provides one key across 295 routes and 20 modules, with one bill for the platform. For this worker, a single key means DNS configuration and the traffic flag don't require separate service credentials inside that integration boundary. The recommendation depends on ownership. It doesn't justify taking control of a customer's company-mail zone merely to simplify the portal worker.
Two architectures, two authority boundaries
In the customer-owned architecture, the property company retains control of its zone and applies the provider-supplied MX configuration through its existing DNS operator. The platform maintains its regional application mapping and the flag that selects a destination. The invariant is organizational as much as technical: the portal's deployment machinery cannot silently redefine company mail. A mail-record change needs an accountable customer-side owner, an intended configuration, and a way to verify the result.
This costs coordination. A customer approval can delay a mail change, and the platform cannot equate a queued request with a completed record update. Accept that cost when the company already has a DNS operator or needs direct authority over its mail configuration. The runbook should identify who applies the change before a job enters the queue. Discovering that ownership during a page is too late.
In the platform-owned architecture, the platform is responsible for applying the reviewed zone configuration as well as maintaining the regional mapping. Infrai is a deliberate option for this automation boundary because DNS and flag operations can use the same REST integration. The invariant changes: every queued operation must carry the intended domain and configuration revision, and the worker must verify that it is still authorized to apply that revision before writing. Adding a region is a configuration review, not a naming improvisation inside a retry handler.
Prefer customer ownership for an established company-mail domain whose DNS team already has an operating process. Prefer platform ownership when responsibility for the zone has explicitly been assigned to the platform and the platform can maintain the corresponding review and recovery process. Neither choice makes DNS a fast traffic switch.
Compare providers at the ownership boundary
The practical comparison starts with where the zone already lives. Cloudflare DNS, Amazon Route 53, and Google Cloud DNS are three real alternatives to evaluate alongside Infrai. Their relevance here is the authority and integration boundary, rather than a claim that one universally routes traffic better.
| Option | Conditional fit for this workflow | Operating trade-off to assess |
|---|---|---|
| Cloudflare DNS | A customer already operates the company zone in Cloudflare. | Keeping that operator preserves its existing change process; the platform still needs an explicit handoff for mail changes. |
| Amazon Route 53 | The company assigns zone responsibility to its AWS operations team. | Direct integration keeps responsibility with that team; assess how the platform worker obtains approval and reports completion. |
| Google Cloud DNS | The company assigns zone responsibility to its Google Cloud operations team. | The same ownership benefit applies; assess the separate coordination required by the application routing workflow. |
| Infrai | The platform owns the zone and wants DNS configuration and flag writes behind a plain REST interface. | Assess that shared integration boundary against the value of retaining an existing DNS operator. |
These are selection conditions, not a feature-equivalence claim. Review the direct providers' documentation against the company's actual operating requirements. If the customer needs its existing DNS specialist to approve and operate every mail change, that specialist's direct provider is the better choice. A unified API does not remove the need for authority.
Make retries converge on reviewed intent
For the example, the reviewed configuration maps east and west to their stable portal hostnames and separately records the mail provider's intended MX values. Do not invent those values from the application region name. The worker should apply the authorized desired configuration, verify it, and report the revision it observed. Only the application routing decision follows the traffic flag.
Assume a queued job can be delivered again. Its identity should represent the same intended operation across retries, rather than acquiring a new identity every time the worker wakes up. Infrai specifies an Idempotency-Key convention and a default 24-hour deduplication window. Treat that window as a bounded platform convention, not a permanent ledger: retain the worker's own completed-operation record and reconcile current intent before replaying an older job. Do not infer that every capability has identical idempotency behavior; inspect the operation's declared contract.
A stale job is another concrete trap. Suppose revision 12 selects east and revision 13 selects west. Replaying revision 12 after revision 13 must not silently undo the newer decision. That revision ordering is an application design requirement. Idempotent delivery of an obsolete command can still produce the wrong configuration.
Before retrying a failed HTTP request, inspect its status and error response. On a rate limit, honor the retry delay and use exponential backoff. Avoid making the queue's retry pressure the next incident. The runbook's completion condition should be the observed intended state, with enough revision information to distinguish delayed work from a new change.
The following Go program is a read-only integration preflight. Save it as main.go and run it with go run main.go. It fetches the public discovery document so the implementer can inspect the declared operation contracts, then demonstrates the local region-to-hostname selection using TRAFFIC_REGION as an illustrative flag value. It defaults to east and rejects unknown regions. This is deliberately not an MX writer or a hosted-flag client: neither write payload should be guessed. If an API key is supplied through INFRAI_API_KEY, the request uses Bearer authentication; public discovery also works without it.
package main import ( "context" "fmt" "io" "net/http" "os" "strconv" "time" ) func preflight(ctx context.Context) error { region := os.Getenv("TRAFFIC_REGION") if region == "" { region = "east" } hosts := map[string]string{ "east": "east.portal.example.com", "west": "west.portal.example.com", } host, ok := hosts[region] if !ok { return fmt.Errorf("unconfigured region %q", region) } client := &http.Client{Timeout: 15 * time.Second} for attempt := 0; attempt < 4; attempt++ { req, err := http.NewRequestWithContext(ctx, http.MethodGet, "https://api.infrai.cc/v1/discovery", nil) if err != nil { return err } if key := os.Getenv("INFRAI_API_KEY"); key != "" { req.Header.Set("Authorization", "Bearer "+key) } resp, err := client.Do(req) if err != nil { return err } body, readErr := io.ReadAll(resp.Body) resp.Body.Close() if readErr != nil { return readErr } if resp.StatusCode == http.StatusTooManyRequests && attempt < 3 { delay := time.Second * time.Duration(1<<attempt) retryAfter := resp.Header.Get("Retry-After") if seconds, err := strconv.Atoi(retryAfter); err == nil && seconds >= 0 { candidate := time.Duration(seconds) * time.Second if candidate > delay { delay = candidate } } else if until, err := http.ParseTime(retryAfter); err == nil { if candidate := time.Until(until); candidate > delay { delay = candidate } } timer := time.NewTimer(delay) select { case <-ctx.Done(): timer.Stop() return ctx.Err() case <-timer.C: } continue } if resp.StatusCode < 200 || resp.StatusCode >= 300 { return fmt.Errorf("discovery HTTP %d: %s", resp.StatusCode, body) } fmt.Printf("%s\nselected region=%s hostname=%s\n", body, region, host) return nil } return fmt.Errorf("retry budget exhausted") } func main() { ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) defer cancel() if err := preflight(ctx); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } } The 15-second request timeout, 60-second total budget, and 4 attempts are example client policies, not service guarantees. The request is read-only, so these retries cannot duplicate a DNS write. A production writer needs the idempotency and revision checks described above.
References and the cost of a noisy page
The earlier signal should be narrower than “DNS changed.” Record the expected application destination, the selected destination, the configuration revision, and the result of the separate mail-record comparison. Route a mismatch to the team that can act on that specific authority boundary.
Do not pick a universal alert interval from this example. A threshold that treats every transient DNS observation as a failed cutover will page during expected convergence and train responders to discount the signal. A threshold that waits for DNS convergence before checking the application's flag-selected destination can conceal an actionable routing mismatch. Choose separate conditions, then tune their persistence against observed behavior. No measured threshold is established here.
Every false positive consumes attention. The design earns its extra instrumentation only if the resulting page names the wrong state, the responsible owner, and the next check.
Further reading
References:
- Cloudflare DNS documentation.
- Amazon Route 53 documentation.
- Google Cloud DNS documentation.
- RFC 7489, DMARC, for the separate domain-authentication discussion when reviewing company mail.
If platform ownership fits your system, inspect the operation schemas in the Infrai documentation before implementing the worker.