01 Run projects list command (Windows/macOS/Linux) with custom query filters to list the IDs of the Google Cloud Platform (GCP) projects currently available in your Google Cloud account:
gcloud projects list
--format="table(projectId)"
02 The command output should return the requested GCP project identifiers (IDs):
PROJECT_ID
cc-main-project-123123
cc-data-project-112233
03 Run dns managed-zones list command (Windows/macOS/Linux) with the ID of the GCP project that you want to examine as the identifier parameter and custom query filters to describe the name and type of each DNS zone available within the selected project:
gcloud dns managed-zones list
--project cc-main-project-123123
--format="table(name,visibility)"
04 The command output should return the name and type (public or private) of each DNS zone created for your project. A public zone has the VISIBILITY attribute set to public:
NAME: trendmicro
VISIBILITY: public
NAME: visionone
VISIBILITY: public
05 Run dns record-sets list command (Windows/macOS/Linux) with the name of the public DNS zone that you want to examine as the identifier parameter and custom output filtering to describe the value (data) for each DNS record created for your DNS zone:
gcloud dns record-sets list
--zone=trendmicro
--format="table(type,rrdatas)"
06 The command output should return the DNS record type and the associated data:
TYPE: A
RRDATAS: ['35.209.130.67']
TYPE: NS
RRDATAS: ['ns-cloud-a1.googledomains.com.', 'ns-cloud-a2.googledomains.com.', 'ns-cloud-a3.googledomains.com.']
TYPE: SOA
RRDATAS: ['ns-cloud-a1.googledomains.com. cloud-dns-hostmaster.google.com. 1 21600 3600 259200 300']
07 Run compute addresses list command (Windows/macOS/Linux) with custom filtering to list the external IP addresses reserved for your GCP account:
gcloud compute addresses list
--filter "addressType~EXTERNAL"
--format="table(name,status,address)"
08 The command output should return a list with external IP addresses available for consumption:
NAME: tm-project5-app-ipv4
STATUS: RESERVED
ADDRESS: 35.186.10.46
NAME: tm-web-portal-ipv4
STATUS: RESERVED
ADDRESS: 35.105.56.10
If one or more IP addresses configured for
A and
AAAA records, returned at step no. 6, are no longer reserved for your GCP account, they will not be listed by the
compute addresses list command at step no. 8. If an IP address associated with a DNS record is no longer reserved for your Google Cloud account, the DNS record pointing to the missing IP becomes a dangling DNS record and can be removed from your Cloud DNS zone.
09 Repeat steps no. 5 - 8 for each public DNS zone that you want to examine.
10 Repeat steps no. 3 – 9 for each GCP project deployed in your Google Cloud account.