Bug #8071
closedDNSimple support for Dynamic DNS no longer working
100%
Description
It seems that DNSimple has deprecated API v1 so all attempts using the current implementation will fail as unauthorized.
This function will need to be modified to use API v2 with a bearer token in the header and the endpoint such as:
https://api.dnsimple.com/v2/$ACCOUNT_ID/zones/$DOMAIN/records/$RECORD_ID.json?"{\"content\":\"$IP\"}"
Here is a link to their API v2 docs: https://developer.dnsimple.com/v2/
Thanks!
Updated by Peter Wilson about 7 years ago
The offending file is:
/etc/inc/dyndns.class
pfSense has the ability to edit files from the webpage GUI (Diagnostics Menu -> Edit File), so just change the existing case statement about half-way through the file, save and you're good to go. I'm not going to check-in changes, I'll leave that to others, sorry.
case 'dnsimple': /* Uses DNSimple's REST API. IP address and TTL sent as JSON, everything else encoded into HTTP Header or URL. Documentation: https://developer.dnsimple.com/v2/zones/records/ EXAMPLE: UPDATE a Zone Record. PATCH /:account/zones/:zone/records/:record curl -H 'Authorization: Bearer <token>' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -X PATCH \ -d '<json>' \ https://api.dnsimple.com/v2/1010/zones/example.com/records/5 */ $needsIP = TRUE; $server = 'https://api.dnsimple.com/v2/'; $jsondata = '{"content":"' . $this->_dnsIP . '","ttl":"' . $this->_dnsTTL . '"}'; curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH"); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json', 'Authorization: Bearer ' . $this->_dnsPass)); curl_setopt($ch, CURLOPT_URL, $server . $this->_dnsUser . '/zones/' . $this->_dnsHost . '/records/' . $this->_dnsZoneID); curl_setopt($ch, CURLOPT_POSTFIELDS, $jsondata); break;
Updated by Jim Pingle over 6 years ago
- Status changed from New to Feedback
- Target version set to 2.4.4
- % Done changed from 0 to 100
PR merged
Updated by Jim Pingle over 6 years ago
Updated by Jim Pingle about 6 years ago
- Status changed from Feedback to Resolved
No feedback after a month, we do not have accounts there to test. Assuming it's OK based on lack of complaints.