High-Availability Redirects for Branded Short Domains: Failover Templates, DNS & Edge Routing Runbook
redirectsfailoverDNSedge routingrunbooktemplates

High-Availability Redirects for Branded Short Domains: Failover Templates, DNS & Edge Routing Runbook

GGoog Labs Editorial
2026-11-11
9 min read

A practical runbook for keeping branded short links available with DNS failover, edge routing, health checks, templates, and recurring drills.

A vanity short domain is only useful when it continues to answer quickly during an origin failure, routing mistake, or provider outage. This runbook shows how to design and test high-availability branded short links with DNS failover, edge routing, health checks, and a repeatable review cadence. The examples are deliberately modular: adapt provider syntax, resource identifiers, and thresholds to your own redirect backends, traffic patterns, and operational requirements.

Overview

A reliable short-link system should separate three concerns: where the domain resolves, how traffic is routed, and where redirect decisions are stored. Keeping these layers distinct makes it easier to fail over one component without changing every branded link.

A common design has a vanity short domain such as go.example.com, an edge or DNS layer in front of two redirect backends, and a small data store or API that maps slugs to destinations. The primary backend handles normal traffic. A secondary backend is kept ready with the same redirect data, or with a deliberately limited emergency map for critical links.

There are two broad failover paths:

  • DNS failover: health-aware DNS changes the answer from a primary endpoint to a secondary endpoint. This is useful when the edge provider or endpoint itself is unavailable, but DNS caching means the change is not instantaneous for every client.
  • Edge failover: a worker, CDN rule, or edge function checks the primary route and sends traffic to a secondary route when the primary is unhealthy. This can reduce dependence on DNS changes, but the edge layer becomes an important availability component.

In practice, teams often use both: stable DNS pointing to an edge provider, with edge-level routing for application failures and DNS-level failover for provider or zone-level incidents. Avoid treating a second record or endpoint as failover by itself. It becomes failover only when it is tested, monitored, and supplied with current redirect data.

What to track

1. Availability of the complete redirect path

Monitor the user-visible URL, not only the backend health endpoint. A synthetic check should request representative short URLs over HTTPS and verify the expected status code, destination host, and key headers. Test at least one ordinary link, one campaign link with query parameters, and one controlled missing slug.

Record separately:

  • DNS resolution success and response time
  • TLS negotiation and certificate validity
  • Edge response time
  • Redirect status and final destination
  • Primary and secondary backend health
  • Rate-limit, bot-filtering, and abuse-control responses

A backend can report healthy while the public redirect is broken because of a certificate, DNS, edge rule, or destination configuration problem.

2. Data parity between redirect backends

Failover is unsafe if the secondary route has stale slugs. Track the timestamp of the last successful synchronization, the number of active links on each side, and a digest or comparison result for critical records. Include destination URLs, status codes, routing conditions, expiration settings, and campaign parameters in the comparison.

For a large link inventory, maintain a small canary set of slugs that exercise each rule type. A full inventory comparison can run less frequently, while canary checks run continuously.

3. DNS and edge configuration drift

Keep the desired DNS records, health checks, routing rules, and redirect settings in version control where practical. Track changes to record names, targets, TTL values, health-check paths, firewall rules, and edge scripts. A configuration diff is often more useful than a dashboard showing only the current state.

4. Redirect behavior and security signals

Track loops, unexpected 3xx chains, destination-host changes, spikes in unknown slugs, and requests that trigger abuse controls. Open redirect prevention should remain active during failover: a fallback service must accept only a stored slug or an approved destination, never an arbitrary URL supplied by the request.

For analytics, measure enough to validate delivery without collecting unnecessary personal data. A privacy-conscious model can retain timestamp buckets, slug identifiers, status outcomes, referrer categories where appropriate, and coarse operational dimensions. See the short-link analytics data model and privacy-friendly analytics guidance when defining retention and bot filtering.

Cadence and checkpoints

Daily or continuous checks

Run synthetic requests from more than one network location if your monitoring setup allows it. Alert on consecutive failures rather than a single transient timeout, and distinguish DNS, TLS, edge, backend, and destination failures. Keep alerts actionable: an on-call person should know which layer failed and which fallback is expected to activate.

Monthly operational review

Review failed checks, failover events, synchronization lag, and the most frequently used branded links. Confirm that critical QR codes and printed materials still resolve. Inspect newly added routing rules for accidental broad matches, unsupported query handling, or destinations that no longer belong to an approved host.

Quarterly failover drill

Perform a controlled exercise in a maintenance window. Start by confirming the current configuration and exporting relevant records. Simulate a primary failure, observe health-check behavior, request representative short URLs, and verify analytics and security controls on the secondary path. Restore the primary route and confirm that traffic returns without stale caching or redirect loops.

Document the observed detection time, time to serve from the secondary, recovery time, and any manual actions. These are operational measurements for your system, not universal targets. Use the results to set thresholds that reflect your traffic and provider behavior.

After every infrastructure change

Repeat preflight checks after changing a domain, DNS provider, edge script, redirect API, backend, certificate, health-check path, or data-sync job. A change that appears unrelated can alter headers, query-string handling, or cache behavior.

DNS health-check and TTL example

Use values that match your recovery objectives and account for resolver caching. The following is a planning example, not a provider-specific prescription:

short.example.com  CNAME  edge-primary.example.net  TTL 60
health check:     https://edge-primary.example.net/health/redirect
expected status:  200
failure window:   3 consecutive failed checks
recovery window:  3 consecutive successful checks

Some DNS platforms cannot place a health-aware alias directly on the exact record shape you need. Confirm whether the provider supports the record type, endpoint, and regional behavior before adopting this pattern. Lower TTLs can help planned changes propagate sooner, but they do not guarantee immediate convergence.

Cloudflare Worker routing sketch

The exact bindings and deployment configuration vary by account and project. Keep the routing decision explicit and fail closed when a slug is unknown.

export default {
  async fetch(request, env) {
    const url = new URL(request.url);
    const slug = url.pathname.replace(/^/+/, "");

    const primary = await fetch(new URL(`/resolve/${encodeURIComponent(slug)}`, env.PRIMARY_API), {
      headers: { "x-redirect-check": "edge" }
    });

    if (primary.ok) return primary;

    const secondary = await fetch(new URL(`/resolve/${encodeURIComponent(slug)}`, env.SECONDARY_API), {
      headers: { "x-redirect-check": "edge-fallback" }
    });

    if (secondary.ok) return secondary;
    return new Response("Link unavailable", { status: 503 });
  }
};

In production, add timeouts, response validation, loop prevention, and a policy for preserving or dropping query parameters. Do not allow the fallback to turn an upstream response body into an arbitrary redirect.

Fastly-style edge rule sketch

Provider-specific VCL or edge-rule syntax changes over time, so treat this as a routing concept to validate against current documentation:

sub vcl_recv {
  if (req.url.path ~ "^/[A-Za-z0-9_-]+$") {
    set req.backend_hint = F_primary;
  }
}

sub vcl_backend_error {
  if (bereq.backend == F_primary && beresp.status >= 500) {
    set bereq.backend = F_secondary;
    return (retry);
  }
}

Limit retries to avoid multiplying load during an incident. Preserve an explicit emergency response when both backends fail.

AWS Route 53 failover record shape

A primary and secondary record normally share the same name and record type, with distinct failover roles and health-check associations. In infrastructure code, model the relationship rather than creating two unmanaged records:

name: short.example.com
record_type: A or alias
primary:
  failover: PRIMARY
  target: primary-endpoint
  health_check: primary-redirect-check
secondary:
  failover: SECONDARY
  target: secondary-endpoint

Verify alias support, health-check semantics, evaluation settings, and the behavior of your chosen record type before applying the configuration.

Terraform module scaffold

variable "hostname" { type = string }
variable "primary_target" { type = string }
variable "secondary_target" { type = string }
variable "health_check_path" { type = string, default = "/health/redirect" }

module "redirect_failover" {
  source = "./modules/redirect-failover"
  hostname = var.hostname
  primary_target = var.primary_target
  secondary_target = var.secondary_target
  health_check_path = var.health_check_path
}

# CI checks should validate:
# - DNS plan contains exactly one primary and one secondary path
# - health-check path returns the expected status
# - canary slugs resolve on both backends
# - no destination violates the approved-host policy

Have CI produce a plan for review and require an explicit approval for DNS or edge changes. Keep provider credentials scoped to the resources the pipeline must manage.

How to interpret changes

A rise in redirect latency is not automatically a DNS problem. Compare DNS time, edge time, backend time, and final-destination time before changing records. If DNS is stable but only one slug family fails, inspect routing rules or link data. If every slug fails at the same time, inspect the edge, certificate, DNS, and provider status path first.

If failover activates repeatedly, do not simply raise the threshold. Check for intermittent origin saturation, an overly strict health endpoint, connection limits, or a secondary route that is being overwhelmed. The health endpoint should represent the ability to serve a real redirect while remaining inexpensive and deterministic.

If the secondary serves links but analytics disappear, treat that as a partial outage. A fallback should preserve the minimum event fields needed for operational validation, or clearly mark events as incomplete. Review the health-check and recovery procedures alongside the 301 versus 302 decision guide before changing redirect status behavior.

After an incident, record the trigger, detection path, user impact, fallback result, data parity, recovery steps, and preventive change. If a routing rule or link import caused the issue, use the bulk link audit workflow before restoring broad publishing access.

When to revisit

Revisit this runbook on a monthly operational cadence and perform a full review at least quarterly. Update it immediately when you change DNS providers, edge vendors, redirect APIs, backend regions, health-check thresholds, certificate automation, analytics behavior, or abuse controls. Provider documentation and edge-rule syntax can change, so confirm examples against current release notes and API documentation before copying them into production.

Use this short checklist for the next review:

  1. Request three representative branded links through the public hostname.
  2. Confirm primary and secondary backends contain the same critical slugs.
  3. Inspect DNS records, TTLs, health checks, and edge rules in version control.
  4. Run a controlled primary failure and measure detection, fallback, and recovery.
  5. Verify that query parameters, analytics, security controls, and approved destinations survive failover.
  6. Record findings, assign corrective actions, and schedule the next drill.

A vanity short domain earns trust through predictable behavior, not merely a short hostname. Treat failover as a recurring operational practice: monitor the complete redirect path, keep data synchronized, test both routing layers, and refresh templates whenever the surrounding infrastructure changes.

Related Topics

#redirects#failover#DNS#edge routing#runbook#templates
G

Goog Labs Editorial

Technical Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.