The domain name is provided by different Host server websites like GoDaddy. Here for learning purposes, I purchased a free domain from the most preferred provider called freenom. (https://www.freenom.com)
- First, sign in to the GCP account
- Network services → cloud DNS → Create DNS Zone
- ADD RECORD SET → With and without WWW.[Text Wrapping Break]


- Freenom → Manage Domain → Management Tools→ Name servers

- The nameserver values are added from Cloud DNS Zone.

- Open wp-admin of GCP website. Goto settings→ General settings→ Change IP address values.

- Change the Ip address of the site to the domain name.
Done..!