azuregoogle-cloud-platformgoogle-cloud-dnsgoogle-cloud-networkinggoogle-cloud-vpn

What is GCP equivalent of DNS Server Configuration for a Virtual Network on Microsoft Azure?


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.


Solution

  • 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.