// Module included in the following assemblies:
//
// * installing/installing_gcp/installing-gcp-account.adoc
// * installing/installing_gcp/installing-gcp-user-infra.adoc
// * installing/installing_gcp/installing-restricted-networks-gcp.adoc

ifeval::["{context}" == "installing-gcp-user-infra-vpc"]
:user-infra-vpc:
endif::[]

:_mod-docs-content-type: PROCEDURE
[id="installation-gcp-dns_{context}"]
= Configuring DNS for {gcp-short}

To install {product-title}, the {gcp-first} account you use must
have a dedicated public hosted zone
ifndef::user-infra-vpc[]
in the same project that you host the {product-title} cluster.
endif::user-infra-vpc[]
ifdef::user-infra-vpc[]
in the project that hosts the shared VPC that you install the cluster into.
endif::user-infra-vpc[]
This zone must be authoritative for the domain. The
DNS service provides cluster DNS resolution and name lookup for external
connections to the cluster.

.Procedure

. Identify your domain, or subdomain, and registrar. You can transfer an existing domain and
registrar or obtain a new one through {gcp-short} or another source.
+
[NOTE]
====
If you purchase a new domain, it can take time for the relevant DNS
changes to propagate. For more information about purchasing domains
through Google, see link:https://domains.google/[Google Domains].
====

. Create a public hosted zone for your domain or subdomain in your {gcp-short} project. See
link:https://cloud.google.com/dns/zones/#creating_public_zones[Creating public zones]
in the {gcp-short} documentation.
+
Use an appropriate root domain, such as `openshiftcorp.com`, or subdomain,
such as `clusters.openshiftcorp.com`.

. Extract the new authoritative name servers from the hosted zone records. See
link:https://cloud.google.com/dns/docs/update-name-servers#look_up_your_name_servers[Look up your Cloud DNS name servers]
in the {gcp-short} documentation.
+
You typically have four name servers.

. Update the registrar records for the name servers that your domain
uses. For example, if you registered your domain to Google Domains, see the
following topic in the Google Domains Help:
link:https://support.google.com/domains/answer/3290309?hl=en[How to switch to custom name servers].

. If you migrated your root domain to {gcp-full} DNS, migrate your DNS records. See link:https://cloud.google.com/dns/docs/migrating[Migrating to Cloud DNS] in the {gcp-short} documentation.

. If you use a subdomain, follow your company's procedures to add its delegation records to the parent domain. This process might include a request to your company's IT department or the division that controls the root domain and DNS services for your company.

ifeval::["{context}" == "installing-gcp-user-infra-vpc"]
:!user-infra-vpc:
endif::[]
