2 Replies Latest reply on Mar 14, 2020 3:49 PM by 4208704

    How Do I Use Oracle Cloud API to Update DNS Resolution Information

    4208704

      I've been working on using the Oracle Cloud API to automate updates for resolution of domain names under my control.  I've figured out enough of the RSA signing and related mechanics to perform successful GETs to endpoints such as /GetZone, but am unsure what JSON payload I need to be PUTting (or POSTing) to a different endpoint such as /UpdateZoneRecords (or perhaps PATCHing /records) in order to update the IP address (contained in the RDATA field below) for a domain name contained in the Domain field, as shown below:

      According to OCI documentation, "[y]ou can change various components of the records within your zones, such as ...relevant RDATA...A lock symbol indicates a protected record [that you cannot change]". As there is no such symbol associated with the RDATA I wish to update,  I would expect that such updates are possible, despite DynDNS per se not currently being implemented within the OCI DNS regime.  So can anyone provide a sample JSON payload that I can PUT or POST to /UpdateZoneRecords or a related endpoint in order to accomplish this?  For example, something along the lines of a PUT of the following payload to /UpdateZoneRecords:

       

      {
          "items": [
              {
                  "domain": "example.com",
                  "recordHash": "261c84e3c11c3f2808fc4f18528f236e",
                  "isProtected": true,
                  "rdata": "1.2.3.4",
                  "rrsetVersion": "1",
                  "rtype": "A",
                  "ttl": 60
              }]
      }
      

       

      As it turns out it IS possible to modify resolution information over API.  A call must first be made to /GetZoneRecords, the "rdata" value of the "A" record contained in the return payload is modified, and the updated JSON object is PUT to /UpdateZoneRecords (noting that the x-content-sha256 header must be present in both the signing string headers *and* the HTTP request headers: a detail easy to miss in the fine print).

       

      Message was edited by: 4208704 ; updated to document successful API-based resolution update