Skip to content

GatewayLocation

Source: src/Cloudflare/Gateway/Location.ts

A Cloudflare Zero Trust Gateway DNS location — a configured source of DNS traffic (an office, a home network, a device fleet) with its own DNS-over-HTTPS endpoint and optional dedicated destination IPs.

Cloudflare assigns each location a stable dohSubdomain; point your network’s DoH resolver at https://<dohSubdomain>.cloudflare-gateway.com/dns-query and Gateway DNS policies apply to its traffic. All declared properties converge in place — nothing on a location forces a replacement.

DoH-only location

const office = yield* Cloudflare.GatewayLocation("Office", {
ecsSupport: false,
});
// Point your resolver at the assigned DoH endpoint:
const doh = office.dohSubdomain;

Location with IPv4 source networks

const office = yield* Cloudflare.GatewayLocation("Office", {
networks: [{ network: "203.0.113.0/24" }],
endpoints: {
doh: { enabled: true },
dot: { enabled: false },
ipv4: { enabled: true },
ipv6: { enabled: false },
},
});