CNAME chasing

CNAME chasing refers to performing multiple DNS queries following one or more CNAME record answers from an initial query. A completely chased CNAME record answer includes at least one CNAME record answer and a final non-CNAME record answer.

Authoritative and recursive DNS resolvers perform CNAME chasing as part of their operation. Cloud DNS has its own CNAME chasing behavior rules which are described on this page. The Cloud DNS CNAME chasing behavior applies to VMs that use the metadata server IP address (169.254.169.254) as their name server, except when an alternative name server is defined in an outbound server policy.

Throughout this page, the term private zone means one of the following types of zones: a private zone with records, a forwarding zone, or a peering zone.

CNAME chasing behavior before January 5, 2027

The following tables describe the current Cloud DNS CNAME chasing behavior, in effect before January 5, 2027.

Chasing single CNAME record answers

Source of single CNAME record answer Cloud DNS resolver behavior
Cloud DNS response policy rule with a single CNAME record

Cloud DNS response policy rules that contain CNAME information in their local data can only contain a single CNAME record.

Cloud DNS doesn't chase the CNAME record by performing any subsequent queries.

Single CNAME record from a private zone with records

Cloud DNS tries to chase the CNAME record by performing subsequent queries in this order:

  • If the record matches a private zone authorized in that VPC network, Cloud DNS returns a record in that zone or NXDOMAIN.
  • If the record matches that VPC network's Compute Engine internal zone, Cloud DNS returns a Compute Engine internal DNS record or NXDOMAIN.
Single CNAME record from a private forwarding zone

Cloud DNS doesn't chase the CNAME record by performing any subsequent queries.

Single CNAME record from a peering zone

Cloud DNS tries to chase the CNAME record by performing subsequent queries in this order:

  • If the record matches a private zone authorized in the VPC network that's the target of the peering zone, Cloud DNS returns a record in that zone or NXDOMAIN.
  • If the record doesn't match a private zone authorized in the peering zone's target VPC network, Cloud DNS tries to chase the CNAME record by performing subsequent queries in this order in the VPC network for which the peering zone is authorized:
    • If the record matches a private zone authorized in that VPC network, Cloud DNS returns a record in that zone or NXDOMAIN.
    • If the record matches that VPC network's Compute Engine internal zone, Cloud DNS returns a Compute Engine internal DNS record or NXDOMAIN.

Handling completely chased CNAME record answers

Source of completely chased CNAME record answer Cloud DNS resolver behavior
Completely chased CNAME record from a private zone with records, forwarding zone, or peering zone Cloud DNS returns the completely chased CNAME record.

CNAME chasing behavior starting January 5, 2027

The following tables describe the Cloud DNS CNAME chasing behavior starting January 5, 2027. For more information about those changes, see the announcement.

Chasing single CNAME record answers

Source of single CNAME record answer Cloud DNS resolver behavior
Cloud DNS response policy rule with a single CNAME record

Cloud DNS response policy rules that contain CNAME information in their local data can only contain a single CNAME record.

Cloud DNS tries to chase the CNAME record by performing subsequent queries according to the VPC name resolution order of the VPC network.

Single CNAME record from a private zone with records or a forwarding zone

Cloud DNS tries to chase the CNAME record by performing subsequent queries according to the VPC name resolution order of the VPC network.

Single CNAME record from a peering zone

Cloud DNS tries to chase the CNAME record by performing subsequent queries in this order:

  • If the record matches a private zone authorized in the peering zone's target VPC network, Cloud DNS returns a record in that zone or NXDOMAIN.
  • If the record doesn't match a private zone authorized in the peering zone's target VPC network, Cloud DNS tries to chase the CNAME record by performing subsequent queries according to the VPC name resolution order of the VPC network for which the peering zone is authorized.

Handling completely chased CNAME record answers

Source of completely chased CNAME record answer Cloud DNS resolver behavior
Completely chased CNAME record from a private zone with records, forwarding zone, or peering zone Cloud DNS returns the completely chased CNAME record.

What's next

  • To find solutions for common issues that you might encounter when using Cloud DNS, see Troubleshooting.