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. - To use the gdcloud CLI, ensure you have it installed. For more information, see Install the gdcloud CLI.
- If you are using
kubectl, 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
You can update a DNS record using the gdcloud CLI or the Kubernetes API.
gdcloud
To update a DNS record, use the gdcloud dns record-sets update
command:
gdcloud dns record-sets update RESOURCE_RECORD_NAME \
[--rrdatas=RECORD_DATA] \
[--ttl=TIME_TO_LIVE] \
[--project=PROJECT_NAMESPACE] \
[--async]
Replace the following:
RESOURCE_RECORD_NAME: The name of the DNS record to update.RECORD_DATA: The updated data for the record. For multiple entries, use a comma-separated list.TIME_TO_LIVE: The updated time to live (TTL) in seconds.PROJECT_NAMESPACE: the namespace of your project. This flag is optional if you have set a default project globally usinggdcloud config set project.--async: Specify this if you want the command to return immediately, rather than wait for the operation to complete. You can usedescribeto check on the status of the operation.
You must specify at least one of the optional flags (--rrdatas, --ttl).
Here are some examples of the --rrdatas flag based on the record type:
Arecord:--rrdatas=10.6.7.8CNAMErecord:--rrdatas=ai.system.example.comTXTrecord:--rrdatas="Example text"PTRrecord:--rrdatas=8.7.6.10.in-addr.arpa.MXrecord:--rrdatas="10 mail.example.com."
API
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 astest.system.example.com.RESOURCE_RECORD_FQDN: the fully qualified domain name (FQDN) for the record, such asanother.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 is300.RR_TYPE: the type of thisResourceRecordSet. The options are:A,CNAME,TXT,PTR, andMX.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:Arecord: the IP address thisArecord points to:type: A rrData: - 10.6.7.8CNAMErecord: the target domain name for thisCNAMErecord:type: CNAME rrData: - "ai.system.example.com"TXTrecord: the text data for thisTXTrecord:type: TXT rrData: - "Example text"PTRrecord: the domain name thisPTRrecord points to, for reverse DNS lookup of an IP address:type: PTR rrData: - "8.7.6.10.in-addr.arpa."MXrecord: the priority and the hostname of the mail server:type: MX rrData: - "10 mail.example.com."
DNS_ZONE_NAME: the name of theManagedDNSZonecustom resource where this record is added. For more information, see Create DNS zones.