Question

How to update DNS records? Receiving "Data needs to end with a dot (.)"

doctl compute domain records list do.${ME}.com
ID           Type     Name            Data   Priority    Port    TTL      Weight
12345678     CNAME    my-domain       ...    0           0       1800     0

But:

doctl compute domain records update do.${ME}.com \
--record-id 12345678 \
--record-ttl 43200

Error: PUT https://api.digitalocean.com/v2/domains/do.${ME}.com/records/12345678: 422 Data needs to end with a dot (.)

And:

https://developers.digitalocean.com/documentation/v2/#update-a-domain-record

“Any attribute valid for the record type can be set to a new value for the record.”

And:

curl \
--request PUT \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${TOKEN}" \
--data '{"ttl": 43200}' https://api.digitalocean.com/v2/domains/do.${ME}.com/records/12345678
{"id":"unprocessable_entity","message":"Data needs to end with a dot (.)"}
Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
November 17, 2020
Accepted Answer

Hi there @dazwilkin,

I was able to reproduce this at my end as well, seems to affect CNAME records and NS records.

I will report this, but in the meantime, I found the following workaround, just pass the data as well:

curl \
--request PUT \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${TOKEN}" \
--data '{"ttl": 43200, "data": "your_cname.example.com."}' https://api.digitalocean.com/v2/domains/do.${ME}.com/records/12345678
{"id":"unprocessable_entity","message":"Data needs to end with a dot (.)"}

Let me know how it goes. Regards, Bobby

Hello all,

I noticed that the issue was only happening for me with MX and NS record creation. Here is how my Terraform looks in case it helps anyone else.

(Notice the period at the end of each “value”)

resource "digitalocean_record" "mx" {
  domain   = digitalocean_domain.default.name
  type     = "MX"
  value    = "mail.fakedomain.com."
  name     = "@"
  priority = "10"
}

resource "digitalocean_record" "ns1" {
  domain = digitalocean_domain.default.name
  type   = "NS"
  name   = "@"
  value  = "ns1.digitalocean.com."
}

resource "digitalocean_record" "ns2" {
  domain = digitalocean_domain.default.name
  type   = "NS"
  name   = "@"
  value  = "ns2.digitalocean.com."
}

resource "digitalocean_record" "ns3" {
  domain = digitalocean_domain.default.name
  type   = "NS"
  name   = "@"
  value  = "ns3.digitalocean.com."
}

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.