softlayer / githubio_source

Templates files for generating softlayer.github.io
Other
1 stars 11 forks source link

Can customer use the API for updating PTR (reverse) name records for both IPv4 and IPv6 #634

Open allmightyspiff opened 7 months ago

allmightyspiff commented 7 months ago
  1. Make sure there is a reverse PTR zone
    
    slcli --format=json call-api SoftLayer_Network_Subnet getReverseDomainRecords --id=<SUBMET ID>  --mask="mask[resourceRecords[data,id,host,domainId]]"

[ { "id": 1975225, "name": "2.d.0.0.1.0.e.1.0.d.0.f.7.0.6.2.ip6.arpa", "networkAddress": "2607:f0d0:1e01:00d2:0000:0000:0000:0000", "resourceRecords": [ { "data": "2607.f0d0.1e01.00d2.0000.0000.0000.0000-ip6.static.sl-reverse.com.", "domainId": 1975225, # DOMAIN ID "host": "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0", "id": 150062376 # RECORD ID }, ...


2. IF there is no zone, create one.

slcli call-api SoftLayer_Network_Subnet createReverseDomainRecords --id=


3. Edit each zone to update the data field. You will need the `id` and `domainId` properties for the next command

slcli -v dns record-edit --by-id --data somefakehost.ibmtest.com


OR with curl

curl -u $SL_USER:$SL_APIKEY -X POST -H "Accept: /" -H "Accept-Encoding: gzip, deflate, compress" -d '{"parameters": [{"data": "somefakehost.ibmtest.com", "domainId": , "expire": null, "host": "e.7.f.f.f.f.f.f.f.f.f.f.f.f.f.f", "id": , "minimum": null, "mxPriority": null, "refresh": null, "retry": null, "ttl": 86400, "type": "ptr"}]}' 'https://api.softlayer.com/rest/v3.1/SoftLayer_Dns_Domain_ResourceRecord//editObject.json'



Same process for a IPv4 address