Internal DNS Zones, Views and Resolver Policy Routing
How Cloudflare Internal DNS, Gateway resolver policies, and private hostname routes resolve internal hostnames for Zero Trust users.
This page summarizes Cloudflare documentation on Internal DNS, Gateway resolver policies, and related paths for resolving private hostnames when users connect through Cloudflare One (WARP client, browser isolation, WAN, or tunnel connectors). Together these pieces let you map internal names to private IPs, apply split-horizon DNS, and steer non-HTTP traffic by hostname without maintaining large static IP route lists.
Internal DNS: what it is and who can use it
Section titled “Internal DNS: what it is and who can use it”Internal DNS is authoritative and recursive DNS for private networks on the same control plane as public Cloudflare DNS, Zero Trust, and application services.
Internal DNS is now generally available. Internal DNS provides authoritative and recursive DNS for private networks on the same global network and control plane you already use for public DNS, Zero Trust, and application services.
— Cloudflare, Internal DNS is now generally available
Internal DNS is included with Cloudflare Gateway for Enterprise customers (Cloudflare Zero Trust Enterprise or Cloudflare Gateway Enterprise). Internal zones do not receive public nameservers; they are queried only through the Gateway DNS resolver.
| Capability | What it does |
|---|---|
| Internal zones | Hold DNS records for resources not exposed on the public Internet |
| DNS views | Logical groupings of zones selected by resolver policies |
| Resolver policies | Decide which view or custom resolver answers a query based on context (identity, geography, source IP, and similar selectors) |
| Split horizon | Different answers for internal versus external resolution, managed as separate views over shared zones |
How a private DNS query flows through Gateway
Section titled “How a private DNS query flows through Gateway”The Gateway resolver sits between the client and your internal zones or custom private resolvers.
You can use different connectivity options to on-ramp your traffic to Cloudflare. Then, Cloudflare Gateway resolver acts as an interface between the DNS client and internal DNS zones.
Internal DNS zones do not get assigned Cloudflare nameservers and can only be queried via Cloudflare Gateway resolver.
— Cloudflare, Internal DNS
Clients can reach the Gateway resolver through DNS locations (UDP/TCP port 53, DNS over TLS, DNS over HTTPS), PAC files, the Cloudflare One Client, clientless browser isolation, or Cloudflare WAN.
For Magic WAN and WARP Connector, DNS can be pointed at shared Gateway resolver IPs 172.64.36.1 and 172.64.36.2 so private-network DNS is filtered without exposing queries to the public Internet, while preserving Source Internal IP for resolver policies. See DNS filtering for private network onramps and Cloudflare Gateway — DNS filtering.
On devices running the Cloudflare One Client, DNS first hits a local proxy (127.0.2.2, 127.0.2.3), then either Local Domain Fallback, Split Tunnels, or Gateway resolver policies decide the next hop. The full flow is documented in How the Cloudflare One Client handles DNS requests.
Internal DNS setup: zone, view, resolver policy
Section titled “Internal DNS setup: zone, view, resolver policy”Cloudflare documents a three-step baseline:
Setting up Internal DNS takes three steps: create a zone, create a view, and define a resolver policy.
— Cloudflare, Internal DNS is now generally available
Create an internal zone and records
Section titled “Create an internal zone and records”In the dashboard, open Internal DNS and create an internal zone. Zones support the same record types as public zones; proxy status does not apply to internal records (Manage internal DNS records).
Via API, set zone type to internal:
curl "https://api.cloudflare.com/client/v4/zones" \ --request POST \ --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ --json '{ "account": { "id": "<ACCOUNT_ID>" }, "name": "corp.internal", "type": "internal" }'Notable zone rules from Manage internal zones:
- An internal zone may share a name with a public zone in the same account.
- One zone can link to multiple views; two zones with the same name cannot share the same view.
- TLD restrictions for public DNS do not apply (for example
xyz.localor even.).
Reference zones: if no record exists in the matching zone, Cloudflare may follow a reference zone (up to five hops). A wildcard in the primary zone beats an exact match in a reference zone. See Reference zones.
Link zones to a DNS view
Section titled “Link zones to a DNS view”Views group internal zones for policy routing (Manage DNS views). A view cannot contain public zones; each zone name must be unique within a view.
Attach a Gateway resolver policy to the view
Section titled “Attach a Gateway resolver policy to the view”In Cloudflare One, go to Traffic policies → Firewall policies → Resolver policies, create an expression for matching traffic, choose Use Internal DNS, and pick the view (Get started — Configure Gateway policies).
Fallback through public DNS (optional):
- Off: Gateway returns the internal response as-is.
- On: On
REFUSED,NXDOMAIN, or certainCNAMEresponses, Gateway retries via Cloudflare1.1.1.1.
Gateway configuration must live in the same account as the internal zone (Internal zones).
Internal DNS analytics use Gateway analytics.
Resolver policies vs Local Domain Fallback
Section titled “Resolver policies vs Local Domain Fallback”Both approaches send some queries to private resolvers, but they differ in where policy runs and what you can log.
Resolver policies provide similar functionality to Local Domain Fallback but occur in Cloudflare Gateway rather than on the local device. This option is recommended if you want more granular control over private DNS resolution.
— Cloudflare, Resolver policies
| Approach | Best when | Gateway DNS policies & logs | Routing granularity |
|---|---|---|---|
| Gateway resolver policies | Resolver reachable via tunnel, WAN, or Internet | Yes | Domain, host, geography, identity, source IP, etc. |
| Local Domain Fallback | Resolver only reachable on the user’s LAN | No (bypasses Gateway resolver) | Per-device fallback domain list |
If your DNS server can be configured to connect to a Cloudflare on-ramp, Cloudflare recommends using Gateway Resolver policies rather than Local Domain Fallback. Gateway Resolver policies provide more visibility by allowing you to log and review DNS traffic.
— Cloudflare, Local Domain Fallback
If both are configured on a device, Local Domain Fallback is evaluated first (Resolver policies).
Custom private resolver policy (tunnel example)
Section titled “Custom private resolver policy (tunnel example)”To forward queries for a domain to an on-prem resolver through a tunnel (Access a web application via private hostname — clientless and MySQL network policy tutorial):
- Under Traffic policies → Resolver policies, add a policy.
- Match traffic, e.g. selector
Domain, operatorin, valueinternalrecord.com. - Under Configure custom DNS resolvers, enter the private IP of your DNS server and choose
<IP-address> - Private(optional custom port). - Ensure the resolver IP is reachable via Networking → Routes (CIDR route on the correct tunnel) and Split Tunnel includes that path (Private DNS).
For regional resolvers, combine Domain with Source Country IP Geolocation and separate policies per region (Implement regional private DNS servers). Verify in Insights → Logs → DNS query logs (check Resolver IP).
Resolver policies support up to 10 IPv4 and 10 IPv6 addresses per policy; default resolver port is 53 (Resolve private DNS). Connect tunnels with QUIC so cloudflared can proxy UDP DNS (Resolver policies — Cloudflare Tunnel).
Hostname routes: reach private apps by name
Section titled “Hostname routes: reach private apps by name”Hostname routes steer traffic for a hostname down a Cloudflare Tunnel or Mesh node so users open familiar URLs (for example wiki.internal.local) instead of IP addresses.
Hostname routes steer traffic for a public or private hostname down a Cloudflare Tunnel. This allows users to access internal resources using familiar URLs (such as wiki.internal.local) rather than IP addresses.
— Cloudflare, Add routes
How hostname routing uses token IPs
Section titled “How hostname routing uses token IPs”When a user requests a private hostname, Cloudflare Gateway assigns an initial resolved IP to route the traffic through your tunnel to the correct private IP address. By default, this IP is drawn from a Cloudflare-owned public IPv4 range (172.64.128.0/20) rather than Carrier-Grade NAT (CGNAT) space, so it does not trigger Google Chrome’s Local Network Access restrictions.
— Cloudflare, Connect a private hostname
Flow in short:
- Client requests
wiki.internal.local. - Gateway DNS returns an initial resolved IP from
172.64.128.0/20(by default). - Traffic goes to the tunnel or Mesh node; Cloudflare maps the token IP to the real private destination.
This enables hostname-based policies for non-HTTP traffic without precomputing destination IPs (Cloudflare Tunnel — Hostname Routes).
| Connector | Hostname routes supported | Minimum version (per docs) |
|---|---|---|
cloudflared |
Yes | 2025.7.0 |
| Cloudflare Mesh | Yes | 2026.6.822.0 (Linux) |
| Cloudflare WAN | No | — |
DNS resolution for private hostname routes
Section titled “DNS resolution for private hostname routes”Gateway must resolve the hostname to a private IP before forwarding (Connect a private hostname):
Scenario A — system resolver on the connector (default): if cloudflared or the Mesh node already resolves the name via host DNS (/etc/resolv.conf), no extra DNS config is required.
Scenario B — dedicated internal DNS server: add a CIDR route for the DNS server IP on the tunnel that reaches that network, then a resolver policy matching Host (for example wiki.internal.local) with Configure custom DNS resolvers and Private routing to that server (same pattern as SSH hostname routes).
On Cloudflare One Client devices, remove the private hostname’s parent domain from Local Domain Fallback so the query goes to Gateway (for example remove internal.local when using ssh.internal.local).
Adding a hostname route alone does not enable end-user connectivity; you still need client-side or clientless access setup (Add routes).
Common mistakes and quick fixes
Section titled “Common mistakes and quick fixes”From Troubleshoot Gateway — Private DNS and related guides:
| Symptom | Typical cause | Fix |
|---|---|---|
| Internal hostname does not resolve | Missing or wrong resolver policy | Match internal suffix or host; forward to correct private resolver or Internal DNS view |
| App unreachable after DNS works | Private IP range excluded in Split Tunnel | Include 10.0.0.0/8 (or your range) in the tunnel path |
| Policies never hit Gateway | Local Domain Fallback lists corporate TLD | Remove domain from fallback; use resolver policies |
| Hostname route fails; IP works | No DNS record / wrong resolver path | Confirm resolution; for Mesh, use MASQUE and Gateway DNS not fallback (Mesh troubleshooting) |
| Browser bypasses WARP DNS | DNS over HTTPS enabled in browser | Disable DoH or align with client architecture (Client architecture — DNS traffic) |
| UDP DNS to private resolver fails | Tunnel not on QUIC / UDP proxy off | Enable Gateway UDP proxy and QUIC transport (Private DNS) |
For integrated SSO on internal web apps, Cloudflare often recommends serving apps on public Cloudflare hostnames and letting the tunnel translate to internal names so all users hit one Access-controlled URL (Applications with integrated SSO).
How to check this on your site
Section titled “How to check this on your site”- From a enrolled device, run
nslookupordigagainst an internal name and confirm the answer matches your zone or regional resolver (regional private DNS tutorial). - In Insights → Logs → DNS query logs, filter the internal FQDN and confirm Resolver IP or Internal DNS view behavior (Gateway analytics for Internal DNS).
- On macOS, Windows, or Linux, verify the OS uses the Cloudflare One Client DNS proxy (
127.0.2.2/127.0.2.3) per client architecture. - For hostname routes, confirm the name resolves to an address in
172.64.128.0/20and that connectivity works to the real private service (Connect a private hostname). - You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact wording you are asking about.