Non-advanced interface mode. Verify that the Advanced toggle is off:
Balancing and dynamic response are available in advanced mode.
Create a DNS record
Navigate to All zones and select the domain zone to which records should be added. Or, click the three-dot icon on the right and then click Go to records.
Click Add record. The form opens in the records list.
In the Type field, select a record type — A, AAAA, NS, CNAME, MX, SRV, HTTPS, TXT, CAA, or SVCB.
In the Name field, specify the subdomain to which the record belongs:
Leave the field blank to add a record for the main domain (apex/naked domain).
Enter the subdomain name — one creates a record for one.yourdomain.com.
Enter an asterisk (*) to add a wildcard record for all subdomains at once.
In the TTL field, specify the time to live in seconds. This determines how long recursive DNS servers cache the record. With a TTL of 300 seconds, a change to an A record value from 1.2.3.4 to 5.6.7.8 takes up to 5 minutes to propagate — resolvers return the old value until the cache expires.
In the Content field, enter the value for the selected record type.
Navigate to All zones and select the domain zone to manage. Or, click the three-dot icon on the right and click Go to records.
Click the pencil icon next to the record to expand the edit panel.
To update the record, change the TTL, value, or both, then click Save.
To delete the record, click Delete record in the expanded panel, then click Yes, delete in the confirmation dialog.
Create, update, and delete DNS records in a zone using the RRset API. The API manages records as RRsets identified by record name and type. An RRset can contain multiple values, such as two IP addresses for the same A record.
RECORD_NAME is the fully qualified domain name (FQDN) of the record. For an apex record it equals ZONE_NAME; for a subdomain it is the full FQDN — www.yourdomain.com.
Create a record
Creates an A record with a TTL of 300 seconds. To assign multiple IP addresses to the same name, add one object to resource_records per address.
import os
from gcore import CDB
client = CDB()
record = client.dns.zones.rrsets.create(
os.environ["RECORD_TYPE"],
zone_name=os.environ["ZONE_NAME"],
rrset_name=os.environ["RECORD_NAME"],
resource_records=[{"content": ["1.2.3.4"]}],
ttl=300,
)
print(record.name, record.type, record.ttl)
for rr in record.resource_records:
print(rr.content)
List the RRsets in a zone to inspect their names, types, TTLs, and current values. The response also includes system records such as NS.
import os
from gcore import CDB
client = CDB()
page = client.dns.zones.rrsets.list(os.environ["ZONE_NAME"])
print(page.total_amount)
for r in page:
print(r.name, r.type, r.ttl)
package main
import (
"context"
"fmt"
"os"
gcore "github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/dns"
)
func main() {
client := gcore.NewClient()
ctx := context.Background()
page, err := client.DNS.Zones.Rrsets.List(ctx, os.Getenv("ZONE_NAME"),
dns.ZoneRrsetListParams{})
if err != nil {
panic(err)
}
fmt.Println(page.TotalAmount)
for _, r := range page.Rrsets {
fmt.Println(r.Name, r.Type, r.Ttl)
}
}
PUT replaces the full RRset — all previous values are overwritten. Send every IP or value the record should have after the update.
import os
from gcore import CDB
client = CDB()
record = client.dns.zones.rrsets.replace(
os.environ["RECORD_TYPE"],
zone_name=os.environ["ZONE_NAME"],
rrset_name=os.environ["RECORD_NAME"],
resource_records=[{"content": ["5.6.7.8"]}],
ttl=600,
)
print(record.ttl)
for rr in record.resource_records:
print(rr.content)
Manage DNS records as code using the gcore_dns_zone_rrset resource from the CDB Terraform provider v2. Each gcore_dns_zone_rrset block declares one RRset — a record name, type, TTL, and one or more values.
Create a DNS record
Declare the zone and the RRset in the same configuration. Set rrset_name to the zone name for an apex record, or to the full FQDN for a subdomain.
Each resource_records entry is one value. The content field is a list of strings whose length and meaning depends on the record type.
Record type reference
The table below shows the content format for each record type. One resource_records entry maps to one value in the RRset.
Record type
content format
Sample value
A
["ipv4"]
["203.0.113.1"]
AAAA
["ipv6"]
["2001:db8::1"]
CNAME
["target."] (trailing dot required)
["origin.yourdomain.com."]
MX
["priority", "hostname."]
["10", "mail.yourdomain.com."]
TXT
["text"]
["v=spf1 mx -all"]
CAA
["flags", "tag", "value"]
["0", "issue", "letsencrypt.org"]
SRV
["priority", "weight", "port", "target."]
["10", "20", "5060", "sip.yourdomain.com."]
Update a record
Edit fields in the resource block and run terraform apply to replace the RRset in-place. PUT semantics apply — all resource_records values must be present after the update.