Project

General

Profile

Bug #8071

DNSimple support for Dynamic DNS no longer working

Added by Kevin Loukinen over 1 year ago. Updated 10 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Dynamic DNS
Target version:
Start date:
11/08/2017
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.4.1
Affected Architecture:
All

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!

History

#1 Updated by Peter Wilson over 1 year 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;

#2 Updated by Jim Pingle 11 months ago

  • Status changed from New to Feedback
  • Target version set to 2.4.4
  • % Done changed from 0 to 100

PR merged

#4 Updated by Jim Pingle 10 months 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.

Also available in: Atom PDF