0

Using the DNS API I am trying to delete the NS and SOA record but I am getting this message:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalidZoneApex",
    "message": "The resource record set 'entity.change.deletions[0]' is invalid because a zone must contain exactly one resource record set of type 'SOA' at the apex."
   },
   {
    "domain": "global",
    "reason": "invalidZoneApex",
    "message": "The resource record set 'entity.change.deletions[1]' is invalid because a zone must contain exactly one resource record set of type 'NS' at the apex."
   }
  ],
  "code": 400,
  "message": "The resource record set 'entity.change.deletions[0]' is invalid because a zone must contain exactly one resource record set of type 'SOA' at the apex."
 }
}

Via the google web console, I can update/modify the records and this helps me to add my custom NS and SOA so that I can use my own vanity name.

Besides that if I want to add a new NS or SOA I get an alreadyexists error.

How could totally manipulate the zone via the DNS API?

nbari
  • 25,603
  • 10
  • 76
  • 131

1 Answers1

1

You can't delete the NS and SOA records because they are system-managed and required by the specifications for DNS - the error message says essentially this. You can't add a new one because you can only have one RRSet of a particular type at a particular name.

In general you can replace record sets by deleting and re-adding them in the same transaction. Which is to say, having a deletions and an additions in the same Changes.create call. I'm not sure offhand whether you can do this for the NS and SOA types at will, but if it works in the Cloud Console it will work on the API as the console just makes normal API calls.

Robert
  • 6,412
  • 3
  • 24
  • 26