What Is DNS Forwarding? Configure Conditional Forwarding and Troubleshoot Failures
DNS forwarding is a name-resolution method in which one DNS server sends a recursive query to another server instead of answering it directly. Distinguish a general server-level forwarder, which handles unresolved queries broadly, from a conditional forwarder, which handles only a chosen namespace such as `east.corp.example.com`. In hybrid networks, forwarding can connect private on-premises and cloud namespaces, but a forwarding rule does not create the network path, firewall access, or return route needed to reach the target DNS server.
How does a DNS forwarder process a query?
When a client asks for the address of app.east.corp.example.com, its recursive DNS server first checks authoritative zones and cached data. If it has no local answer and the query matches a conditional forwarding zone, it sends a recursive query to the configured DNS target and returns the response to the client. Without a matching conditional rule, the server might use a server-level forwarder or another recursive path such as root hints. Exact precedence depends on the server's zone, delegation, and forwarding configuration.
For example, suppose the corporate DNS servers are authoritative for corp.example.com, while cloud DNS manages private records in gcp.corp.example.com. A conditional forwarder on-premises can send queries for gcp.corp.example.com to an inbound resolver address in the cloud. In the reverse direction, a cloud DNS forwarding rule can send corp.example.com queries to the corporate DNS servers. Each direction needs its own rule, address reachability, and access control; configuring one direction does not configure the other.
When should you use a general or conditional forwarder?
A server-level forwarder sends general unresolved queries to an upstream DNS server when local zones, cache, and more specific rules do not answer them. It can centralize an organization's public-name resolution policy or delegate Internet recursion to a chosen DNS service. Because it affects many queries, consider upstream availability, timeouts, and whether the server falls back to root hints.
A conditional forwarder sends only queries matching a specific DNS suffix to designated servers. It fits namespaces whose authoritative DNS is managed separately, such as an Active Directory domain, a business-unit subdomain, or a cloud private zone. More-specific suffixes can take precedence according to the product, so document overlapping zones. Conditional forwarding routes queries; it is not the same as delegating authority with NS records.
| Method | Queries sent | Main design concern |
|---|---|---|
| Server-level forwarding | General queries the server cannot answer locally | Affects broad unresolved traffic; verify upstream and fallback policy |
| Conditional forwarding | Queries for a specified domain or child namespace | Suffix matching, longer-suffix precedence, overlapping zones, and loops |
| DNS delegation | Authority for a child namespace is assigned to another set of name servers | Parent NS records and the delegated authoritative zone must agree |
What does the flow look like in a hybrid cloud?
First decide which DNS system owns each namespace. For example, if corporate DNS owns corp.example.com and cloud private DNS owns gcp.corp.example.com, configure the on-premises DNS server to conditionally forward the cloud suffix to the cloud inbound resolver, and configure a cloud outbound rule for the corporate suffix to the on-premises DNS servers. Separately from DNS, the networks need a VPN or dedicated connection, routes, and firewall rules for UDP and TCP port 53.
Cloud products use different terms and control points. Google Cloud DNS uses forwarding zones and server policies for VPC-specific inbound and outbound queries. Route 53 VPC Resolver uses inbound/outbound endpoints and rules associated with VPCs. Azure DNS Private Resolver uses inbound/outbound endpoints and forwarding rulesets linked to virtual networks. Product details and limits differ, so check current provider documentation.
If several VPCs or VNets share a hub, verify which networks should be associated with each forwarding rule. DNS forwarding does not automatically create network peering and may not traverse a peering route. A circular design, where a query is forwarded to a resolver and then matches the same rule again, can lead to timeouts or SERVFAIL. Trace the rule and resolver path until the query reaches the authoritative server.
Configure a conditional forwarder in Windows Server
The following procedure applies to the DNS Server role on Windows Server 2016, 2019, 2022, and 2025. You need the DNS Server role, an account in DnsAdmins or an equivalent delegated role, and the DnsServer PowerShell module. The sample names and IP addresses are illustrative; replace them with authoritative DNS targets in your network. Record the current configuration and a recovery plan before changing production DNS.
Record the current state and check target reachability. On the DNS server, open PowerShell and capture the existing forwarders and zones.
Get-DnsServerForwarder Get-DnsServerRecursion Get-DnsServerZone | Where-Object ZoneType -eq 'Forwarder' | Select-Object ZoneName, MasterServers, ForwarderTimeout, UseRecursionQuery the target DNS server directly. Test a known name over both UDP and TCP from the DNS server itself.
Resolve-DnsName -Name 'host1.east.corp.example.com' ` -Server '10.20.0.10' -DnsOnly Resolve-DnsName -Name 'host1.east.corp.example.com' ` -Server '10.20.0.10' -DnsOnly -TcpOnlyTesting from the DNS server checks its source address, route, firewall, and the target's willingness to accept recursive queries. A test from an administrator workstation does not prove the DNS server has the same path.
Create the conditional forwarder. This example forwards
east.corp.example.comto two corporate DNS targets and does not opt into recursion fallback.Add-DnsServerConditionalForwarderZone ` -Name 'east.corp.example.com' ` -MasterServers @('10.20.0.10','10.20.0.11') ` -PassThruMicrosoft documents that omitting
-UseRecursioncan prevent a conditional forwarder from falling back to another recursive path when its targets do not respond. Decide this policy deliberately: sending an internal-only name to public recursion can produce incorrect answers or disclose query names. If you use DNS Manager, inspect its fallback default and explicitly set it withSet-DnsServerConditionalForwarderZonewhen needed.Verify the configuration and response. Inspect the stored zone settings, then query a known, preferably uncached record from the DNS server and a representative client.
Get-DnsServerZone -Name 'east.corp.example.com' | Format-List ZoneName, ZoneType, MasterServers, ForwarderTimeout, UseRecursion Resolve-DnsName -Name 'host1.east.corp.example.com' ` -Server '127.0.0.1' -DnsOnlyA correct result should contain the expected address for the known record.
NXDOMAINis a DNS answer that says the name does not exist; it is not itself a connectivity failure. If you need to prove that the designated forwarder handled the query, use a controlled uncached name and inspect DNS logs or capture packets on the DNS server. A successful answer might have come from a cache or locally hosted authoritative zone.Isolate failures one layer at a time. Check direct UDP/TCP queries to the target, DNS Server service, port 53, routes, target-side query permissions, the conditional zone name, and fallback behavior. Distinguish a silent target,
SERVFAIL, andNXDOMAIN; change one setting at a time and retest.
If the change causes a problem, remove the new conditional zone or restore the saved target list and fallback settings. Clearing a production DNS cache can temporarily increase upstream traffic, so do it only after considering impact and an approved maintenance window.
How do you prevent loops and incorrect forwarding?
A common loop occurs when DNS server A forwards corp.example.com to B and B forwards the same namespace back to A. Overlapping suffix rules and wildcard forwarding can also send a query to an unexpected server. Map one authoritative owner and the forwarding direction for each namespace. Do not create a conditional forwarder for the same namespace the DNS server already hosts authoritatively; depending on the product, the setup may be rejected or the authoritative zone may answer before forwarding.
Forwarding is not a security boundary. Restrict recursive queries to authorized clients, and allow only the required network paths and UDP/TCP port 53. Separately decide whether a failed conditional query for a private namespace may fall back to public recursion.
DNS forwarding connects query paths between separately managed DNS namespaces. Before adding a rule, define namespace ownership, request and return paths, fallback policy, and loop risks. Then test directly from the DNS server, from a representative client, and during an upstream failure.
References
[DNS forwarding and fallback behavior in Windows Server](https://learn.microsoft.com/en-us/windows-server/networking/dns/forwarding)
[Configure and validate DNS forwarding in Windows Server](https://learn.microsoft.com/en-us/windows-server/networking/dns/configure-dns-forwarding)
[Google Cloud DNS forwarding zones and resolution order](https://docs.cloud.google.com/dns/docs/zones/zones-overview)
[Inbound and outbound DNS forwarding in Google Cloud](https://docs.cloud.google.com/dns/docs/overview)
[Google Cloud hybrid DNS best practices](https://docs.cloud.google.com/dns/docs/best-practices)
[Amazon Route 53 VPC Resolver and endpoints](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver.html)
[Azure DNS Private Resolver overview](https://learn.microsoft.com/en-us/azure/dns/dns-private-resolver-overview)
[Azure DNS Private Resolver endpoints and rulesets](https://learn.microsoft.com/en-us/azure/dns/private-resolver-endpoints-rulesets)