♊️ GemiNews 🗞️
(dev)
🏡
📰 Articles
🏷️ Tags
🧠 Queries
📈 Graphs
☁️ Stats
💁🏻 Assistant
💬
🎙️
Demo 1: Embeddings + Recommendation
Demo 2: Bella RAGa
Demo 3: NewRetriever
Demo 4: Assistant function calling
Editing article
Title
Summary
Content
<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*j8DUdJ5W5vY70kgVGcU5GA.png" /></figure><h3>Background</h3><p>Google Cloud customers often need to route particular Google-bound traffic like <em>storage.googleapis.com</em> from their on-premises network to their private Google Cloud Platform (GCP) connectivity — VPN or interconnect — rather than over the Internet, for efficiency, security, or compliance reasons. For example, this is necessary for cases like when a <a href="https://cloud.google.com/vpc-service-controls/docs/overview">VPC SC perimeter</a> surrounds Cloud Storage buckets since external requests are blocked, allowing only those from within the perimeter. If the on-premises network is part of the VPC SC perimeter, client devices there will need to forward their requests through the private connectivity to GCP to access the bucket.</p><p>In certain situations, redirecting all *.googleapis.com traffic from the on-premises network to GCP may not be feasible, and a more granular approach is required. This is particularly relevant when only a specific subset of clients should be directed to GCP projects within the company, while other clients accessing general Google APIs such as Search, Maps, or even Cloud Storage should retain access to public internet endpoints. This article outlines how to configure GCP and Windows DNS Server to achieve this selective redirection.</p><h3>Solution</h3><p>The solution presented will handle a more complex scenario where various on-premises clients are linked to different GCP environments, <em>production</em> and <em>development</em>, in addition to regular clients accessing Google APIs through public endpoints. The solution assumes that clients can be identified based on their IP subnets, primarily those connecting to GCP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*-sRE3m2lByAAz4DR5E9KvQ.png" /></figure><p>Due to the need to consider both DNS records and client-specific fields when responding to DNS queries, modifications to DNS results are necessary. This can be achieved using DNS Response Policies (<a href="https://www.ietf.org/archive/id/draft-vixie-dnsop-dns-rpz-00.txt">RPZ</a>), or in our case <a href="https://learn.microsoft.com/en-us/windows-server/networking/dns/deploy/dns-policies-overview">DNS Policies</a> that Windows Server 2016 introduced to provide similar capabilities to RPZ. DNS Policies provide enhanced flexibility and capabilities, such as Geo-location Traffic Management (ensuring clients receive the IP address of the geographically closest resource) and Split Brain DNS (tailoring responses based on the client’s network location).</p><h4>GCP-only clients</h4><p>To ensure that all traffic to Google APIs from the on-premises network is forwarded to GCP, one solution is for the on-premises network to become authoritative for the googleapis.com zone. With Windows DNS Policies, you can create your own records for your authoritative zones and implement the capabilities mentioned earlier through new objects:</p><ul><li><a href="https://learn.microsoft.com/en-us/powershell/module/dnsserver/add-dnsserverzonescope?view=windowsserver2022-ps">Zone Scope</a>: a zone comprises one default zone and can have various zone scopes. Each scope may contain an identical set of DNS records, but with different IP addresses assigned to each scope.</li><li><a href="https://learn.microsoft.com/en-us/powershell/module/dnsserver/add-dnsserverqueryresolutionpolicy?view=windowsserver2022-ps">Query Resolution Policy</a>: a policy applied to zone scopes that establishes procedures for resolving DNS queries using predefined criteria. These criteria could include the client’s subnet or the type of record being queried.</li><li><a href="https://learn.microsoft.com/en-us/powershell/module/dnsserver/add-dnsserverclientsubnet?view=windowsserver2022-ps">Client Subnet</a>: an object representing subnets corresponding to clients. You can utilize client subnet objects in query resolution policies to match incoming queries to specific clients.</li></ul><p>To access Google APIs that are supported by VPC Service Controls, you must configure <a href="https://cloud.google.com/vpc/docs/configure-private-google-access-hybrid">Private Google Access for on-premises</a>. This involves redirecting traffic to the <em>private.googleapis.com</em> or the <em>restricted.googleapis.com</em> special domain names. The <em>restricted range</em>, 199.36.153.4/30, allows access to Google APIs and services that are supported by VPC Service Controls and blocks access to those services that are not supported. We will use this range in our configuration.</p><p>Within the googleapis.com zone scope, the on-premises DNS server should set up a CNAME record from *.googleapis.com to restricted.googleapis.com. Additionally, an A record should be created, pointing to the IP addresses within the restricted range. Further steps, such as configuring routing from the on-premises network to the restricted range in GCP, are necessary. Refer to the official documentation for more details.</p><p>However, this configuration will not work for regular clients that do not require to be forwarded to GCP. Any client not recognized as being in a particular subnet that requires redirection won’t match any resolution policy and will continue with the usual resolution procedure. As a result, they’ll get a reply with the records from the regular authoritative googleapis.com zone. Of course companies can’t be authoritative for Google APIs and their public endpoints.</p><h4>GCP and non-GCP clients</h4><p>In situations where both GCP and non-GCP or regular clients reside within the on-premises network, it is not feasible for the on-premises infrastructure to serve as the authoritative source for the googleapis.com zone. As a result, any queries made by these clients need to be forwarded to external resolvers. However, it’s important to note that using a resolver for Google APIs will only provide access to public endpoints.</p><p>Fortunately, Windows DNS Policies provide an object that we can use to resolve this issue:</p><ul><li><a href="https://learn.microsoft.com/en-us/powershell/module/dnsserver/add-dnsserverrecursionscope?view=windowsserver2022-ps">Recursion Scope</a>: similar to zone scopes, DNS recursion can have a default behavior as well as <em>scopes</em> where recursion or resolution behaves differently by directing to a unique set of forwarders.</li></ul><p>By configuring query resolution policies to selectively choose recursion scopes based on criteria such as the client subnet, it becomes possible to resolve the same domains to different IP addresses. This approach provides a flexible solution for managing DNS resolution in complex network environments.</p><h4>High-level diagram</h4><p>The DNS process we’ll implement is outlined in the high-level diagram below. Three types of on-premises clients are used:</p><ul><li>Non-GCP or regular clients, which should continue to access Google APIs and the Internet as usual. They should not be affected by any modifications made to the DNS server.</li><li>GCP clients in a production environment, where Google APIs resolution should be forwarded to Cloud DNS in a production VPC typically through an Interconnect connection.</li><li>GCP clients in a development environment, where Google APIs resolution should be forwarded to Cloud DNS in a development VPC, usually through an Interconnect or VPN connection.</li></ul><p>Each client sends a DNS query for a given domain, such as storage.googleapis.com. Depending on the type of client, the response to the query may vary because different clients use different resolvers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/0*-MVssu9jEQuBtR3N" /></figure><p>Cloud DNS will act as the resolver for GCP clients. We will configure private zones to CNAME *googleapis.com to restricted.googleapis.com with A records from the 199.36.153.4/30 range. To accommodate both the production and development environments, the restricted range will be split into two, with each environment receiving two IPs. This setup allows traffic routing from the on-premises network to the appropriate physical connectivity. Additionally, inbound server policies will be created in the production and development VPC networks, and the inbound forwarder IPs will be identified. Refer to the official <a href="https://cloud.google.com/vpc/docs/configure-private-google-access-hybrid">Google Cloud documentation</a> for instructions on configuring the GCP side.</p><p>As shown in the picture, queries are matched based on the client subnet <strong>and</strong> the specified domain. If we didn’t include the domain of the request as a criterion, all GCP client queries for non-authoritative zones would be forwarded to Cloud DNS. While this setup could work, customers typically prefer to redirect only DNS GCP traffic to GCP.</p><h4>Configuration of Windows DNS Server</h4><p>Following is the configuration of the on-premises DNS server. It uses the DNS Policy objects described previously. To create these objects, run PowerShell as an administrator on the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*N6cPF_ZFXhFoif-GuHbseQ.png" /></figure><ul><li>Create ClientSubnets objects in the DNS server for production and development clients, to identify DNS queries from each other and from the rest of clients. Let’s assume the range 10.100.0.0/24 is used for production and 10.200.0.0/24 for development. Multiple IP ranges can be specified if necessary. Notably, ClientSubnets objects do not automatically replicate across DNS servers. Therefore, if there are multiple servers, they must be explicitly added to each server.</li></ul><pre>> $dcs = (Get-ADDomainController -Filter *).Name<br>> foreach ($dc in $dcs) {<br> Add-DnsServerClientSubnet -Name "Prod" -IPv4Subnet "10.100.0.0/24" -ComputerName $dc<br> Add-DnsServerClientSubnet -Name "Dev" -IPv4Subnet "10.200.0.0/24" -ComputerName $dc<br>}</pre><ul><li>Create recursion scopes for both production and development to send traffic to Cloud DNS. Utilize the inbound forwarder IP addresses (inbound server policies) specific to each environment. Let’s assume those forwarder IPs are 172.20.0.2 (prod) and 172.30.0.2 (dev).</li></ul><pre>> Add-DnsServerRecursionScope -Name "CloudDNSProd" -Forwarder "172.20.0.2" -EnableRecursion $true<br>> Add-DnsServerRecursionScope -Name "CloudDNSDev" -Forwarder "172.30.0.2" -EnableRecursion $true</pre><ul><li>Now comes a not well-documented aspect. The initial query for googleapis.com from a client populates the global cache of the Windows DNS server, <em>corrupting</em> the cache for subsequent clients. To prevent this issue, it’s necessary to <em>shard</em> or <em>partition</em> the DNS server’s global cache before implementing any query resolution policy for the recursion scopes. The partitioning process is based on creating zone scopes, as the cache is treated as an additional zone.<br>Create zone scopes for the DNS server cache, which will serve as cache shards dedicated to clients meeting the query resolution policies that we will create later.</li></ul><pre>> Add-DnsServerZoneScope -ZoneName "..cache" -Name "CloudDNSProdCache"<br>> Add-DnsServerZoneScope -ZoneName "..cache" -Name "CloudDNSDevCache"</pre><ul><li>Bind the cache zone scopes to query resolution policies for them to take effect. The policies will use FQDN and client subnet criteria to map to the zone scopes. As client subnets, query resolution policy objects do not replicate across DNS servers.</li></ul><pre>> $dcs = (Get-ADDomainController -Filter *).Name<br>> foreach ($dc in $dcs) {<br> Add-DnsServerQueryResolutionPolicy -Name "CloudDNSProdCache" -Fqdn "EQ,*.googleapis.com" -ClientSubnet "EQ,Prod" -Action ALLOW -ZoneScope "CloudDNSProdCache" -ZoneName "..cache" -ComputerName $dc<br> Add-DnsServerQueryResolutionPolicy -Name "CloudDNSDevCache" -Fqdn "EQ,*.googleapis.com" -ClientSubnet "EQ,Dev" -Action ALLOW -ZoneScope "CloudDNSDevCache" -ZoneName "..cache" -ComputerName $dc<br> }</pre><ul><li>Create query resolution policies with the same criteria to map to the recursion scopes created previously.</li></ul><pre>> $dcs = (Get-ADDomainController -Filter *).Name<br>> foreach ($dc in $dcs) {<br> Add-DnsServerQueryResolutionPolicy -Name "CloudDNSProd" -Fqdn "EQ,*.googleapis.com" -ClientSubnet "EQ,Prod" -Action ALLOW -ApplyOnRecursion -RecursionScope "CloudDNSProd" -ComputerName $dc<br> Add-DnsServerQueryResolutionPolicy -Name "CloudDNSDev" -Fqdn "EQ,*.googleapis.com" -ClientSubnet "EQ,Dev" -Action ALLOW -ApplyOnRecursion -RecursionScope "CloudDNSDev" -ComputerName $dc<br> }</pre><ul><li>To troubleshoot DNS issues, consider taking these additional steps:<br>- Clear the DNS caches. This may temporarily affect DNS performance, but it can resolve some issues.<br>- Inspect the caches to identify any irregularities or errors.</li></ul><pre>> Clear-DnsServerCache<br>> Clear-DnsServerCache -CacheScope "CloudDNSProdCache"<br>> Clear-DnsServerCache -CacheScope "CloudDNSDevCache"<br>> Show-DnsServerCache<br>> Show-DnsServerCache -CacheScope "CloudDNSProdCache"<br>> Show-DnsServerCache -CacheScope "CloudDNSDevCache"</pre><p>After applying these changes, different types of on-premises clients should now resolve *.googleapis.com to different IP addresses.</p><h3>Final notes</h3><ul><li>The shell commands show how to configure redirection for *.googleapis.com. However, this is usually not the only domain required for GCP services to work from on-premises networks. Domains such as accounts.google.com or gcr.io are also typically needed. You would need to add corresponding Add-DnsServerQueryResolutionPolicy commands with those FQDNs. A list of possible domains can be found in the <a href="https://cloud.google.com/vpc/docs/configure-private-google-access-hybrid#config-choose-domain">documentation</a>.</li><li>Although it is possible to redirect only some services like Google Cloud Storage or BigQuery specifying domains like storage.googleapis.com, using *.googleapis.com makes the DNS configuration simpler and you can still control access to GCP services based on IAM roles (as you should).</li><li>There is no GUI to configure DNS Policies, only PowerShell. However, if you already automate your IT processes with PowerShell this approach can become an advantage, as it allows for easier integration and management of DNS settings.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=874aa2cc1a35" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/google-apis-from-windows-dns-server-874aa2cc1a35">Google APIs from Windows DNS Server</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>
Author
Link
Published date
Image url
Feed url
Guid
Hidden blurb
--- !ruby/object:Feedjira::Parser::RSSEntry title: Google APIs from Windows DNS Server published: 2024-04-18 06:14:53.000000000 Z categories: - dns - infrastructure - windows - google-cloud-platform url: https://medium.com/google-cloud/google-apis-from-windows-dns-server-874aa2cc1a35?source=rss----e52cf94d98af---4 entry_id: !ruby/object:Feedjira::Parser::GloballyUniqueIdentifier is_perma_link: 'false' guid: https://medium.com/p/874aa2cc1a35 carlessian_info: news_filer_version: 2 newspaper: Google Cloud - Medium macro_region: Blogs content: '<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*j8DUdJ5W5vY70kgVGcU5GA.png" /></figure><h3>Background</h3><p>Google Cloud customers often need to route particular Google-bound traffic like <em>storage.googleapis.com</em> from their on-premises network to their private Google Cloud Platform (GCP) connectivity — VPN or interconnect — rather than over the Internet, for efficiency, security, or compliance reasons. For example, this is necessary for cases like when a <a href="https://cloud.google.com/vpc-service-controls/docs/overview">VPC SC perimeter</a> surrounds Cloud Storage buckets since external requests are blocked, allowing only those from within the perimeter. If the on-premises network is part of the VPC SC perimeter, client devices there will need to forward their requests through the private connectivity to GCP to access the bucket.</p><p>In certain situations, redirecting all *.googleapis.com traffic from the on-premises network to GCP may not be feasible, and a more granular approach is required. This is particularly relevant when only a specific subset of clients should be directed to GCP projects within the company, while other clients accessing general Google APIs such as Search, Maps, or even Cloud Storage should retain access to public internet endpoints. This article outlines how to configure GCP and Windows DNS Server to achieve this selective redirection.</p><h3>Solution</h3><p>The solution presented will handle a more complex scenario where various on-premises clients are linked to different GCP environments, <em>production</em> and <em>development</em>, in addition to regular clients accessing Google APIs through public endpoints. The solution assumes that clients can be identified based on their IP subnets, primarily those connecting to GCP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*-sRE3m2lByAAz4DR5E9KvQ.png" /></figure><p>Due to the need to consider both DNS records and client-specific fields when responding to DNS queries, modifications to DNS results are necessary. This can be achieved using DNS Response Policies (<a href="https://www.ietf.org/archive/id/draft-vixie-dnsop-dns-rpz-00.txt">RPZ</a>), or in our case <a href="https://learn.microsoft.com/en-us/windows-server/networking/dns/deploy/dns-policies-overview">DNS Policies</a> that Windows Server 2016 introduced to provide similar capabilities to RPZ. DNS Policies provide enhanced flexibility and capabilities, such as Geo-location Traffic Management (ensuring clients receive the IP address of the geographically closest resource) and Split Brain DNS (tailoring responses based on the client’s network location).</p><h4>GCP-only clients</h4><p>To ensure that all traffic to Google APIs from the on-premises network is forwarded to GCP, one solution is for the on-premises network to become authoritative for the googleapis.com zone. With Windows DNS Policies, you can create your own records for your authoritative zones and implement the capabilities mentioned earlier through new objects:</p><ul><li><a href="https://learn.microsoft.com/en-us/powershell/module/dnsserver/add-dnsserverzonescope?view=windowsserver2022-ps">Zone Scope</a>: a zone comprises one default zone and can have various zone scopes. Each scope may contain an identical set of DNS records, but with different IP addresses assigned to each scope.</li><li><a href="https://learn.microsoft.com/en-us/powershell/module/dnsserver/add-dnsserverqueryresolutionpolicy?view=windowsserver2022-ps">Query Resolution Policy</a>: a policy applied to zone scopes that establishes procedures for resolving DNS queries using predefined criteria. These criteria could include the client’s subnet or the type of record being queried.</li><li><a href="https://learn.microsoft.com/en-us/powershell/module/dnsserver/add-dnsserverclientsubnet?view=windowsserver2022-ps">Client Subnet</a>: an object representing subnets corresponding to clients. You can utilize client subnet objects in query resolution policies to match incoming queries to specific clients.</li></ul><p>To access Google APIs that are supported by VPC Service Controls, you must configure <a href="https://cloud.google.com/vpc/docs/configure-private-google-access-hybrid">Private Google Access for on-premises</a>. This involves redirecting traffic to the <em>private.googleapis.com</em> or the <em>restricted.googleapis.com</em> special domain names. The <em>restricted range</em>, 199.36.153.4/30, allows access to Google APIs and services that are supported by VPC Service Controls and blocks access to those services that are not supported. We will use this range in our configuration.</p><p>Within the googleapis.com zone scope, the on-premises DNS server should set up a CNAME record from *.googleapis.com to restricted.googleapis.com. Additionally, an A record should be created, pointing to the IP addresses within the restricted range. Further steps, such as configuring routing from the on-premises network to the restricted range in GCP, are necessary. Refer to the official documentation for more details.</p><p>However, this configuration will not work for regular clients that do not require to be forwarded to GCP. Any client not recognized as being in a particular subnet that requires redirection won’t match any resolution policy and will continue with the usual resolution procedure. As a result, they’ll get a reply with the records from the regular authoritative googleapis.com zone. Of course companies can’t be authoritative for Google APIs and their public endpoints.</p><h4>GCP and non-GCP clients</h4><p>In situations where both GCP and non-GCP or regular clients reside within the on-premises network, it is not feasible for the on-premises infrastructure to serve as the authoritative source for the googleapis.com zone. As a result, any queries made by these clients need to be forwarded to external resolvers. However, it’s important to note that using a resolver for Google APIs will only provide access to public endpoints.</p><p>Fortunately, Windows DNS Policies provide an object that we can use to resolve this issue:</p><ul><li><a href="https://learn.microsoft.com/en-us/powershell/module/dnsserver/add-dnsserverrecursionscope?view=windowsserver2022-ps">Recursion Scope</a>: similar to zone scopes, DNS recursion can have a default behavior as well as <em>scopes</em> where recursion or resolution behaves differently by directing to a unique set of forwarders.</li></ul><p>By configuring query resolution policies to selectively choose recursion scopes based on criteria such as the client subnet, it becomes possible to resolve the same domains to different IP addresses. This approach provides a flexible solution for managing DNS resolution in complex network environments.</p><h4>High-level diagram</h4><p>The DNS process we’ll implement is outlined in the high-level diagram below. Three types of on-premises clients are used:</p><ul><li>Non-GCP or regular clients, which should continue to access Google APIs and the Internet as usual. They should not be affected by any modifications made to the DNS server.</li><li>GCP clients in a production environment, where Google APIs resolution should be forwarded to Cloud DNS in a production VPC typically through an Interconnect connection.</li><li>GCP clients in a development environment, where Google APIs resolution should be forwarded to Cloud DNS in a development VPC, usually through an Interconnect or VPN connection.</li></ul><p>Each client sends a DNS query for a given domain, such as storage.googleapis.com. Depending on the type of client, the response to the query may vary because different clients use different resolvers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/0*-MVssu9jEQuBtR3N" /></figure><p>Cloud DNS will act as the resolver for GCP clients. We will configure private zones to CNAME *googleapis.com to restricted.googleapis.com with A records from the 199.36.153.4/30 range. To accommodate both the production and development environments, the restricted range will be split into two, with each environment receiving two IPs. This setup allows traffic routing from the on-premises network to the appropriate physical connectivity. Additionally, inbound server policies will be created in the production and development VPC networks, and the inbound forwarder IPs will be identified. Refer to the official <a href="https://cloud.google.com/vpc/docs/configure-private-google-access-hybrid">Google Cloud documentation</a> for instructions on configuring the GCP side.</p><p>As shown in the picture, queries are matched based on the client subnet <strong>and</strong> the specified domain. If we didn’t include the domain of the request as a criterion, all GCP client queries for non-authoritative zones would be forwarded to Cloud DNS. While this setup could work, customers typically prefer to redirect only DNS GCP traffic to GCP.</p><h4>Configuration of Windows DNS Server</h4><p>Following is the configuration of the on-premises DNS server. It uses the DNS Policy objects described previously. To create these objects, run PowerShell as an administrator on the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*N6cPF_ZFXhFoif-GuHbseQ.png" /></figure><ul><li>Create ClientSubnets objects in the DNS server for production and development clients, to identify DNS queries from each other and from the rest of clients. Let’s assume the range 10.100.0.0/24 is used for production and 10.200.0.0/24 for development. Multiple IP ranges can be specified if necessary. Notably, ClientSubnets objects do not automatically replicate across DNS servers. Therefore, if there are multiple servers, they must be explicitly added to each server.</li></ul><pre>> $dcs = (Get-ADDomainController -Filter *).Name<br>> foreach ($dc in $dcs) {<br> Add-DnsServerClientSubnet -Name "Prod" -IPv4Subnet "10.100.0.0/24" -ComputerName $dc<br> Add-DnsServerClientSubnet -Name "Dev" -IPv4Subnet "10.200.0.0/24" -ComputerName $dc<br>}</pre><ul><li>Create recursion scopes for both production and development to send traffic to Cloud DNS. Utilize the inbound forwarder IP addresses (inbound server policies) specific to each environment. Let’s assume those forwarder IPs are 172.20.0.2 (prod) and 172.30.0.2 (dev).</li></ul><pre>> Add-DnsServerRecursionScope -Name "CloudDNSProd" -Forwarder "172.20.0.2" -EnableRecursion $true<br>> Add-DnsServerRecursionScope -Name "CloudDNSDev" -Forwarder "172.30.0.2" -EnableRecursion $true</pre><ul><li>Now comes a not well-documented aspect. The initial query for googleapis.com from a client populates the global cache of the Windows DNS server, <em>corrupting</em> the cache for subsequent clients. To prevent this issue, it’s necessary to <em>shard</em> or <em>partition</em> the DNS server’s global cache before implementing any query resolution policy for the recursion scopes. The partitioning process is based on creating zone scopes, as the cache is treated as an additional zone.<br>Create zone scopes for the DNS server cache, which will serve as cache shards dedicated to clients meeting the query resolution policies that we will create later.</li></ul><pre>> Add-DnsServerZoneScope -ZoneName "..cache" -Name "CloudDNSProdCache"<br>> Add-DnsServerZoneScope -ZoneName "..cache" -Name "CloudDNSDevCache"</pre><ul><li>Bind the cache zone scopes to query resolution policies for them to take effect. The policies will use FQDN and client subnet criteria to map to the zone scopes. As client subnets, query resolution policy objects do not replicate across DNS servers.</li></ul><pre>> $dcs = (Get-ADDomainController -Filter *).Name<br>> foreach ($dc in $dcs) {<br> Add-DnsServerQueryResolutionPolicy -Name "CloudDNSProdCache" -Fqdn "EQ,*.googleapis.com" -ClientSubnet "EQ,Prod" -Action ALLOW -ZoneScope "CloudDNSProdCache" -ZoneName "..cache" -ComputerName $dc<br> Add-DnsServerQueryResolutionPolicy -Name "CloudDNSDevCache" -Fqdn "EQ,*.googleapis.com" -ClientSubnet "EQ,Dev" -Action ALLOW -ZoneScope "CloudDNSDevCache" -ZoneName "..cache" -ComputerName $dc<br> }</pre><ul><li>Create query resolution policies with the same criteria to map to the recursion scopes created previously.</li></ul><pre>> $dcs = (Get-ADDomainController -Filter *).Name<br>> foreach ($dc in $dcs) {<br> Add-DnsServerQueryResolutionPolicy -Name "CloudDNSProd" -Fqdn "EQ,*.googleapis.com" -ClientSubnet "EQ,Prod" -Action ALLOW -ApplyOnRecursion -RecursionScope "CloudDNSProd" -ComputerName $dc<br> Add-DnsServerQueryResolutionPolicy -Name "CloudDNSDev" -Fqdn "EQ,*.googleapis.com" -ClientSubnet "EQ,Dev" -Action ALLOW -ApplyOnRecursion -RecursionScope "CloudDNSDev" -ComputerName $dc<br> }</pre><ul><li>To troubleshoot DNS issues, consider taking these additional steps:<br>- Clear the DNS caches. This may temporarily affect DNS performance, but it can resolve some issues.<br>- Inspect the caches to identify any irregularities or errors.</li></ul><pre>> Clear-DnsServerCache<br>> Clear-DnsServerCache -CacheScope "CloudDNSProdCache"<br>> Clear-DnsServerCache -CacheScope "CloudDNSDevCache"<br>> Show-DnsServerCache<br>> Show-DnsServerCache -CacheScope "CloudDNSProdCache"<br>> Show-DnsServerCache -CacheScope "CloudDNSDevCache"</pre><p>After applying these changes, different types of on-premises clients should now resolve *.googleapis.com to different IP addresses.</p><h3>Final notes</h3><ul><li>The shell commands show how to configure redirection for *.googleapis.com. However, this is usually not the only domain required for GCP services to work from on-premises networks. Domains such as accounts.google.com or gcr.io are also typically needed. You would need to add corresponding Add-DnsServerQueryResolutionPolicy commands with those FQDNs. A list of possible domains can be found in the <a href="https://cloud.google.com/vpc/docs/configure-private-google-access-hybrid#config-choose-domain">documentation</a>.</li><li>Although it is possible to redirect only some services like Google Cloud Storage or BigQuery specifying domains like storage.googleapis.com, using *.googleapis.com makes the DNS configuration simpler and you can still control access to GCP services based on IAM roles (as you should).</li><li>There is no GUI to configure DNS Policies, only PowerShell. However, if you already automate your IT processes with PowerShell this approach can become an advantage, as it allows for easier integration and management of DNS settings.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=874aa2cc1a35" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/google-apis-from-windows-dns-server-874aa2cc1a35">Google APIs from Windows DNS Server</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>' rss_fields: - title - published - categories - url - entry_id - content - author author: Julio Diez
Language
Active
Ricc internal notes
Imported via /Users/ricc/git/gemini-news-crawler/webapp/db/seeds.d/import-feedjira.rb on 2024-04-18 09:13:17 +0200. Content is EMPTY here. Entried: title,published,categories,url,entry_id,content,author. TODO add Newspaper: filename = /Users/ricc/git/gemini-news-crawler/webapp/db/seeds.d/../../../crawler/out/feedjira/Blogs/Google Cloud - Medium/2024-04-18-Google_APIs_from_Windows_DNS_Server-v2.yaml
Ricc source
Show this article
Back to articles