9 min read

Learning Objectives

By the end of this module, you will be able to:

  • Design Cloud DNS zones and records for a production domain, within the service's record types, TTL range and limits
  • Compose cross-site failover from load balancer health checks, IP failover and your own monitoring that updates Cloud DNS records through the API
  • Use the record TTL as the dominant lever on the client-side recovery time, and size it deliberately
  • Explain why DNS steering requires a stateless application tier
  • Create a primary zone and the records of a two-endpoint failover pair in the Data Center Designer (DCD), and wire the record change to the API

Unit 3.7: DNS and Failover Routing

Introduction

FinCorp's portal runs in Frankfurt, with a recovery VDC in Berlin. The risk office asks for automated failover between the two. Inside each site, the load balancers and IP failover already move traffic between healthy instances (Units 3.3 to 3.5). Between sites, the steering layer is DNS: clients must be sent to whichever site is serving.

Cloud DNS gives you authoritative zones, a full record API and a short TTL floor. Health checks live in the load balancers, and a record answers with what was last written to it. This unit therefore designs failover as layers, with the cross-site decision made by your monitoring, and ends by building the zone and records the monitoring will update.

1. Zones and Records

1.1 Primary and Secondary Zones

A primary zone holds the records of a domain or subdomain on IONOS CLOUD nameservers. When you create it, Cloud DNS provides four nameservers, ns-ic.ui-dns.com, ns-ic.ui-dns.de, ns-ic.ui-dns.org and ns-ic.ui-dns.biz, which you configure at your domain registrar. Changes to nameservers can take up to 48 hours, so delegate the zone well before any failover test. A zone can be Enabled or Disabled; when you disable it, its SOA record is removed and the zone is no longer associated with the IONOS CLOUD nameservers.

If your primary zone stays with another DNS provider, Cloud DNS can host a secondary zone on its secondary nameservers, which keeps resolution working if the external primary becomes unresponsive. DNSSEC is supported and managed through the API.

The following limits apply per contract:

Resource Limit
Primary zones 50000
Secondary zones 100000
Records 100000
Reverse (PTR) records 5000

A public primary or secondary zone costs 1,50 € per 30 days; reverse DNS records carry no charge.

1.2 Records

Cloud DNS supports the record types A, AAAA, CNAME, ALIAS, MX, NS, SOA, SRV, TXT, CAA, SSHFP, TLSA, SMIMEA, DS, HTTPS, SVCB, OPENPGPKEY, CERT, URI, RP and LOC. An empty record name creates an apex record, and * creates a wildcard record. Reverse DNS is available for reserved IPv4 addresses and for the public IPv6 addresses of your VDCs; a reserved IPv4 address otherwise carries the default PTR ipAAA-BBB-CCC-DDD.pbiaas.com.

Access is governed like any other resource. Contract administrators, owners and users with the Access and manage DNS privilege can create and manage zones and records, and by default the API is open to contract owners and administrators only. Grant the privilege to the group of the monitoring service account, not to a person (Unit 2.2).

1.3 The Nameserver Platform

The nameserver infrastructure is distributed across 14 points of presence in Europe and the USA, and answers from an anycast network. The service-level agreement measures the monthly average availability of the name servers: below 99.995% (and at or above 99.99%), the credit note is 10% of one month's billing; below 99.99% (and at or above 99.95%), 25%; below 99.95%, 100%. This SLA covers name resolution of your zones. It says nothing about whether the endpoint a record points to is alive; that is the next layer.

2. Failover as Composed Layers

2.1 The Layers

The platform composes failover rather than selling it as one product (Unit 1.3). The health signal comes from the balancers and your monitoring, and the record holds whatever was last written to it:

Layer Mechanism Scope Failure detected by
Target ALB or NLB health checks remove failed targets One balancer The balancer
Instance pair IP failover group moves a reserved IP between VMs One public LAN Your HA software on the VMs
Database Cluster-internal promotion (Unit 5.3) One cluster The managed service
Site Your monitor updates the Cloud DNS record to the other site's endpoint Cross-VDC, cross-region Your monitoring

The first three layers react within a site. Only the last moves traffic between Frankfurt and Berlin, and every part of it is yours: the probe, the decision, the API call and the failback.

2.2 Designing the Monitor

Run the monitor outside both sites, so that losing Frankfurt does not also blind the component that must declare Frankfurt lost. Probe each site's public endpoint directly, through per-site names such as portal-fra and portal-txl, and probe what users need, such as an HTTP health path through the ALB, not just a ping. Require several consecutive failures before acting, so that a 5-second maintenance interruption of a balancer does not trigger a cross-region failover.

The action is a single record update. The Cloud DNS API supports a PUT on a record with a UUID that you generate: if the record does not exist it is created, and if it exists with a different configuration it is updated. That makes the failover call idempotent, so a monitor can repeat it safely.

curl --request PUT "https://dns.de-fra.ionos.com/zones/<zone-uuid>/records/<record-uuid>" \
  --header "Authorization: Bearer <token>" --header "Content-Type: application/json" \
  --data '{"properties": {"name": "portal", "type": "A", "content": "<berlin-alb-ip>", "ttl": 60, "enabled": true}}'

The snippet carries one architectural point: the failover is an ordinary write to a record whose identity you own, so the monitor needs only the zone and record UUIDs and a token with the DNS privilege. Automation beyond this belongs in the Developer course.

2.3 The TTL Is the Recovery Lever

The time to live (TTL) tells resolvers how long to cache an answer. Cloud DNS accepts TTLs from 60 seconds to 604,800 seconds, with a default of 3600 seconds. After your monitor updates the record, a client that cached the old answer keeps using it until its cache expires. Client-side switchover therefore takes roughly detection time plus up to one TTL.

With the default, that is up to an hour after detection; with the floor, about a minute. A lower TTL means more queries to the nameservers and no faster detection, so FinCorp sets 60 seconds on the failover record portal only and keeps the default on records that never move. Some resolvers and clients cache longer than the TTL they receive, so the runbook measures the real switchover during each test.

2.4 DNS Steers New Connections Only

A record change affects only lookups made after the cache expires. Established connections to the failed site break and must be re-established by the client, and the new connection lands in Berlin with no memory of the old session. The application tier must therefore be stateless: sessions live in a shared or replicated store, and every request can be served by either site. DNS also moves no data. The data-continuity plane, replication and recovery points of the databases, is designed separately (Unit 7.1).

DCD Implementation Walkthrough

You will create FinCorp's portal zone with the records of a two-endpoint failover pair, then connect the record to the monitor's failover action. The zone and record create path is in the DCD; the failover itself is an API call made by your monitoring, as designed in Section 2.

Prerequisites: the Access and manage DNS privilege or the Administrator role; the reserved public listener addresses of the ALBs in fc-prod-fra-core and fc-prod-txl-dr; access to the domain registrar; a monitoring service account in a group with the DNS privilege.

Build goal: Create a zone and a failover record across a two-endpoint pair, health-checked by your monitoring.

Steps (in the Data Center Designer):

  1. Go to Menu > Network Services > Cloud DNS > Public zones tab and select Create primary DNS zone.
  2. Keep Enabled, enter the domain (for example fincorp.example) as Name, add a Description, and select Create zone. Copy the four nameservers from the acknowledgement message.
  3. At your registrar, set the domain's nameservers to the four Cloud DNS nameservers, and allow up to 48 hours before relying on the delegation.
  4. Select Primary Zones in the drop-down list, open the zone in the DNS ZONES column, and select Create record.
  5. Create the per-site records: Name portal-fra, Type A, Content the Frankfurt ALB address; then portal-txl with the Berlin ALB address. Review Preview and select Save for each. The monitor probes these names.
  6. Create the failover record: Name portal, TTL 60, Type A, Content the Frankfurt ALB address. Select Save, and wait until its STATE is Available.
  7. Record the zone UUID and the UUID of portal in the monitor's configuration, and give the monitor a token of its service account. Configure the failover action as the PUT from Section 2.2 with the Berlin address, and the failback action with the Frankfurt address.
  8. Test in a maintenance window: take the Frankfurt endpoint out of service, confirm that the monitor rewrites portal, and measure how long clients take to reach Berlin. Fail back the same way.

Common mistakes:

  • Treating the DNS record as health-aware. It serves what was last written to it; the health decision is your monitor's.
  • Leaving the failover record at the default TTL of 3600 seconds. Clients then keep the dead address for up to an hour.
  • Running the monitor inside the site it watches.
  • Testing failover before the registrar delegation has taken effect.
  • Failing over a stateful tier. Sessions held on Frankfurt servers are lost on the move.
  • Giving a personal account's token to the monitor instead of a service account's.

Summary

Cloud DNS is the steering layer for cross-site failover: authoritative zones on anycast nameservers in 14 points of presence, 21 record types, an idempotent record API and a TTL floor of 60 seconds. Endpoint health comes from elsewhere, so failover is composed from load balancer health checks and IP failover inside each site and your own monitor rewriting a short-TTL record between sites. Detection plus one TTL bounds the client-side switchover, and only a stateless tier survives the move.

Key Points:

  • Delegate a primary zone with its four nameservers early; nameserver changes can take up to 48 hours.
  • TTLs range from 60 to 604,800 seconds, default 3600; give only failover records the 60-second floor.
  • Cross-site failover is your monitor calling the Cloud DNS API; a PUT with your own record UUID is idempotent.
  • DNS steers new connections only; keep the application tier stateless and design data continuity separately.
  • The DNS SLA covers the name servers, not the endpoints behind the records.