• GoDaddy Community
  • Website Design & Development
  • Website Design & Development

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 

    Creating subdomain NS records with API

    My root domain's DNS is managed in GoDaddy, however I am trying add NS records from an external provider (AWS Route53) to delegate the subdomain's DNS management. As outlined here, this is achieved by creating four NS records on the parent domain's zone file, one for each of their provided NS.

    Using the GoDaddy GUI I can do this with no issues, however I wish to automate this process via the API when creating new subdomains. I am using this endpoint as outlined in GoDaddy's API docs: https://developer.godaddy.com/doc/endpoint/domains#/v1/recordAdd
    My request is as follows:

    https://api.godaddy.com/v1/domains/<MY_DOMAIN>/records
    [
    	{
            "data": "<AWS NS record value>",
            "name": "<subdomain-name>",
            "type": "NS"
    	}
    ]

    and the returned error is:

    422 Unprocessable Entity
    {
        "code": "FAILED_NAME_SERVER_VALIDATION",
        "fields": [
            {
                "code": "INVALID_FIELD",
                "message": "Nameservers [ns31.domaincontrol.com] ",
                "path": "records"
            },
            {
                "code": "INVALID_FIELD",
                "message": "Nameservers [ns32.domaincontrol.com] ",
                "path": "records"
            }
        ],
        "message": "Failed to update nameservers"
    }


    I have created CNAME records using this same endpoint with no issue, but any NS record I attempt to create throws this error regardless of the values. If I intentionally supply an invalid value for NS, I receive an additional error in the returned array, so I can tell it is not failing to validate my correct NS value.

    {
        "code": "INVALID_FIELD",
        "message": "Nameservers [ns-100.foobar.awsdns-100.org] Unavailable",
        "path": "records"
    }


    It seems like the API endpoint is performing some additional checks on the root domain's NS and falling over itself, preventing the endpoint from being usable to create NS records like this.

    I've found two other forum posts where users are encountering the same error, with no helpful response or insight provided.

     

    https://au.godaddy.com/community/Managing-Domains/create-NS-record-for-subdomain-with-api/td-p/11456...
    https://au.godaddy.com/community/Managing-Domains/Adding-Nameserver-for-subdomain/m-p/44755#M11957

    Is there any chance of this endpoint being corrected to allow creating NS records for a subdomain? I can see the GUI makes a POST request to v2 of the API and seemingly works without issue, but this doesn't seem to be publicly available at the moment. Any help or insight into the problem would be appreciated. Cheers.

    0 REPLIES 0