-1

I want my virtual machines that takes place in a VPC network on GCP be able to resolve my on-premise network DNS server records like *.mycompany.com

Now I can't nslookup for a DNS like example.mycompany.com, to be able to do this in the Azure, there is a configuration that you can set your DNS server for a specific virtual network, after that all resources in that virtual network uses that DNS server. Is there any idea that what's the GCP equivalent for DNS settings for a specific network?

azure portal dns configuration for a virtual network

I need to do this on the GCP side. I followed this link on the GCP docs and tried to create private DNS zone for forwarding but tbh couldn't understand completely how it works. Because unlike Azure, it seems to a bit complicated to me.

Note: For both Azure and GCP there are VPN tunnels between on-premise network and cloud.

Thanks in advance.

John Hanley
  • 74,467
  • 6
  • 95
  • 159
happy-integer
  • 383
  • 1
  • 3
  • 15

2 Answers2

2

The Google Cloud equivalent to Azure Custom DNS server is using a DNS Policy to enable an alternative name server.

gcloud dns policies create POLICY_NAME \
    --description=DESCRIPTION \
    --networks=VPC_NETWORK_LIST \
    --alternative-name-servers=ALTERNATIVE_NAMESERVER_LIST

gcloud dns policies create

I recommend forwarding zones, but creating a policy might be easier for you to implement.

John Hanley
  • 74,467
  • 6
  • 95
  • 159
0

found this, for the DNS server policies: Applying Cloud DNS server policies