cancel
Showing results for 
Search instead for 
Did you mean: 

create NS record for subdomain with api

Hi all,

 

I'm trying to create a subzone (eg: mytest.mydomain.com) and to set NS records for this subzone to the nameservers of another provider.

Using the GUI console, everything works fine. If I try instead to use the API, the requested NS records are not created and the desired values are used to update the zone's root NS record(mydomain.com). This is my request done with curl:

curl -i -X PATCH -H"Authorization: sso-key $myapikey:$myapisecret" -H "Content-type: application/json" "https://api.godaddy.com/v1/domains/mydomain.com/records" -d @data.json

content of data.json is:

[
    {"data": "ns-cloud-e1.googledomains.com", "name": "mytest.mydomain.com", "type": "NS", "ttl": 3600},
    {"data": "ns-cloud-e2.googledomains.com", "name": "mytest.mydomain.com", "type": "NS", "ttl": 3600}
]

Has someone the same problem? What am I doing wrong?

 

2 REPLIES 2
Moderator
Moderator

Re: create NS record for subdomain with api

Hi @viralizemedia,

 

Thanks for for posting. This appears to be account specific, you'll need to email api@godaddy.com so they can review the issue you're having using our API endpoint environment.

 

 

Lisi - GoDaddy | Community Moderator
24/7 support available at x.co/247support
New

Re: create NS record for subdomain with api

I have the same problem. Example request:

curl -H 'content-type: application/json' \
     -H 'Authorization: sso-key api_key:api_secret' \
     -X PATCH \
     -d '[{"type":"NS","ttl":3600,"name":"he","data":"ns.example.com"}]' \
     https://api.godaddy.com/v1/domains/my_domain.com/records

And API answers me as follows:

 

< HTTP/1.1 422 Unprocessable Entity
< Content-Type: application/json
< Content-Length: 277
< Strict-Transport-Security: max-age=15724800; includeSubDomains
< X-Request-Id: cbfad8d7ec289e7ed2fee85209d4d7b7
< X-DataCenter: PHX3
< Expires: Fri, 14 Jun 2019 04:56:11 GMT
< Cache-Control: max-age=0, no-cache, no-store
< Pragma: no-cache
< Date: Fri, 14 Jun 2019 04:56:11 GMT
< Connection: close
<
{"code":"FAILED_NAME_SERVER_VALIDATION","fields":[{"code":"INVALID_FIELD","message":"Nameservers [ns67.domaincontrol.com] ","path":"records"},{"code":"INVALID_FIELD","message":"Nameservers [ns68.domaincontrol.com] ","path":"records"}],"message":"Failed to update nameservers"}

I wrote about this at api@godaddy.com and received a very strange answer:

I understand that you are writing in about gettig an error when adding a NS record. 
The issue is that we cannot validate the nameserver you are using "ns.example.com"
As this is not a valid nameserver according to versign.
Because you are adding a 3rd are our system isn't able to validate all 3 of them.

But where does this validity NS record? No request with any NS record does not pass, and manually through the web interface you can successfully create  same NS record ...