GoDaddy API is asking for nameservers to create a DNS record

149 Views Asked by At

I'm using the GoDaddy API to do things like register domains and configure their DNS. This endpoint creates a DNS record, and I'm using it to create an A record.

PUT /v1/domains/{domain}/records

Weirdly, it is responding with this error:

Status code 422
{
  "code":"MISSING_NAME_SERVER",
  "message":"At least two NS records must be specified in the request body"
}

This makes no sense because the schema does not allow nameservers... and an A record doesn't need a nameserver. The domain itself does indeed have nameservers set (set during the registration).

This is what I'm passing to the endpoint to generate the above error:

[
    {
    "data": "<my IP address>",
    "name": "",
    "ttl": 3600,
    "type": "A",
    "port":443,
    "priority": 0,
    "protocol": "https",
    "service": "",
    "weight": 0,
    "type": "A"
  }
]
1

There are 1 best solutions below

1
Todd Booth On

You wrote, "PUT /v1/domains/{domain}/records"

The documentation says to use PATCH (not PUT).

I verified that by using PUT I received your error and with PATCH it worked.

Regards, Teacher Todd