@@ -65,16 +65,14 @@ func ResourceRecord() *schema.Resource {
6565 Description : "The name of the record" ,
6666 ForceNew : true ,
6767 Optional : true ,
68- StateFunc : func (val any ) string {
69- // This function normalizes the name before storing it in state
70- // It converts FQDN (e.g., "_dmarc.example.com.") to relative format (e.g., "_dmarc")
71- value := val .(string )
72- if value == "@" || value == "" {
73- return ""
74- }
75-
76- return value
77- },
68+ StateFunc : func (val any ) string {
69+ value := val .(string )
70+ if value == "@" || value == "" {
71+ return ""
72+ }
73+
74+ return value
75+ },
7876 DiffSuppressFunc : func (k , oldValue , newValue string , d * schema.ResourceData ) bool {
7977 dnsZone := d .Get ("dns_zone" ).(string )
8078
@@ -259,7 +257,6 @@ func resourceRecordCreate(ctx context.Context, d *schema.ResourceData, m any) di
259257 geoIP , okGeoIP := d .GetOk ("geo_ip" )
260258 recordType := domain .RecordType (d .Get ("type" ).(string ))
261259 recordData := d .Get ("data" ).(string )
262- // Normalize the record name to relative format (handles FQDN with trailing dot)
263260 recordName := normalizeRecordName (d .Get ("name" ).(string ), dnsZone )
264261 record := & domain.Record {
265262 Data : recordData ,
@@ -373,7 +370,6 @@ func resourceDomainRecordRead(ctx context.Context, d *schema.ResourceData, m any
373370 }
374371
375372 idRecord := locality .ExpandID (d .Id ())
376- // Normalize the record name to relative format (handles FQDN with trailing dot)
377373 recordName := normalizeRecordName (d .Get ("name" ).(string ), dnsZone )
378374
379375 res , err := domainAPI .ListDNSZoneRecords (& domain.ListDNSZoneRecordsRequest {
@@ -454,7 +450,6 @@ func resourceDomainRecordUpdate(ctx context.Context, d *schema.ResourceData, m a
454450 }
455451
456452 geoIP , okGeoIP := d .GetOk ("geo_ip" )
457- // Normalize the record name to relative format (handles FQDN with trailing dot)
458453 recordName := normalizeRecordName (d .Get ("name" ).(string ), dnsZone )
459454 record := & domain.Record {
460455 Name : recordName ,
0 commit comments