Update DNS records

This document guides you on how to update previously created DNS records in Google Distributed Cloud (GDC) air-gapped.

Before you begin

To update DNS records in GDC, you must have the following:

  • An existing public or private DNS zone with DNS records.
  • The necessary identity and access roles. To manage DNS records for your project, ask your Project IAM Admin to grant you the Managed DNS Project Admin (managed-dns-project-admin) role.
  • A kubeconfig file for the global API server. If you have not yet generated this file, see Sign in. For more information, see Global and zonal API servers.

Update a DNS record

Use the Kubernetes API in GDC to update a DNS record:

kubectl --kubeconfig GLOBAL_API_SERVER apply -f - <<EOF
apiVersion: networking.global.gdc.goog/v1
kind: ResourceRecordSet
metadata:
  name: RESOURCE_RECORD_NAME
  namespace: PROJECT_NAMESPACE
spec:
  name:  RESOURCE_RECORD_FQDN
  ttlSeconds: TIME_TO_LIVE
  type: RR_TYPE
  rrData:
  - RECORD_DATA
  dnsZone: DNS_ZONE_NAME
EOF

Replace the following:

  • GLOBAL_API_SERVER: the global API server's kubeconfig path. For more information, see Global and zonal API servers. If you have not yet generated a kubeconfig file for the API server, see Sign in for details.
  • PROJECT_NAMESPACE: the namespace of your project.
  • RESOURCE_RECORD_NAME: the DNS record to update, such as test.system.example.com.
  • RESOURCE_RECORD_FQDN: the fully qualified domain name (FQDN) for the record, such as another.ai.system.example.com.
  • TIME_TO_LIVE: the updated time to live (TTL) for this record, in seconds, which specifies how long DNS resolvers can cache this record before querying for it again. This field is optional. The default value is 300.
  • RR_TYPE: the type of this ResourceRecordSet. The options are: A, CNAME, TXT, PTR, and MX.
  • RECORD_DATA: the updated data for all resource records in the RRset. Each entry represents a separate resource record. Here are some examples depending on the record type:

    • A record: the IP address this A record points to:

      type: A
      rrData:
      - 10.6.7.8
      
    • CNAME record: the target domain name for this CNAME record:

      type: CNAME
      rrData:
      - "ai.system.example.com"
      
    • TXT record: the text data for this TXT record:

      type: TXT
      rrData:
      - "Example text"
      
    • PTR record: the domain name this PTR record points to, for reverse DNS lookup of an IP address:

      type: PTR
      rrData:
      - "8.7.6.10.in-addr.arpa."
      
    • MX record: the priority and the hostname of the mail server:

      type: MX
      rrData:
      - "10 mail.example.com."
      
  • DNS_ZONE_NAME: the name of the ManagedDNSZone custom resource where this record is added. For more information, see Create DNS zones.