Create DNS records

This page guides you through how to create DNS records in Google Distributed Cloud (GDC) air-gapped. Create new DNS entries to map domain names to resources.

The intended audience for this page is platform administrators and application operators responsible for managing DNS records within a project.

After you have created your DNS zone, you can create different types of DNS records to point your domain names and subdomains to your services. Create the following DNS record types:

  • Address (A) record: maps a domain name to one or more IPv4 addresses. This record is the most fundamental record type for pointing a domain to a server.
  • Canonical Name (CNAME) record: creates an alias of one domain name to another canonical (authoritative) domain name. This record type is useful for redirecting traffic or simplifying DNS management.
  • Text (TXT) record: lets you associate arbitrary text with a domain name. These records are often used for verification purposes or to store information like Sender Policy Framework (SPF) records for email authentication.
  • Pointer (PTR) record: maps an IP address back to a domain name, also known as reverse DNS lookup. This record is often used for email server reputation and logging analysis.
  • Mail Exchanger (MX) record: specifies the mail servers responsible for accepting email for a domain. This is essential for setting up email services.

Before you begin

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

Create a DNS record

  • Create and apply a ResourceRecordSet resource to create a DNS record within an existing managed DNS zone:

    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: your chosen unique name for this ResourceRecordSetresource within the namespace, such as cname.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 time to live (TTL) in seconds for this record. 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 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.