OPNsense Forum

English Forums => General Discussion => Topic started by: Vinez on May 06, 2021, 03:28:59 pm

Title: Custom DDNS - How to see the HTTP Response
Post by: Vinez on May 06, 2021, 03:28:59 pm
Hello all,

Hope you can help me, I have searched the forum but found no related posts so here i go

I am setting up a custom ddns with my registrar, I have it fully configured, however i need to troubleshoot it by viewing the http response. i have turned on verbose logging and can see some messages in the logs. However i need to see the full http response.... How can i get this information? Do i need to setup SSH access and find it in the logs somewhere else? Is it not saved in the logging?

Thanks for helping in advance !
Title: Re: Custom DDNS - How to see the HTTP Response
Post by: Nnyan on May 06, 2021, 07:03:53 pm
Other then what you have already done I'm not sure if that's available in OPNsense and it doesn't look to be a feature of the plugin.  I normally just get a DDNS update tool that works with your registrar (or a command line tool like noipy) that allows you to see the full response.
Title: Re: Custom DDNS - How to see the HTTP Response
Post by: muchacha_grande on May 07, 2021, 03:08:13 pm
Just try the updating url in your browser and see what you get. The DDNS service will usually respond with something like IPv4: <address> or IPv6: <address> whet it succeed
Title: Re: Custom DDNS - How to see the HTTP Response
Post by: Vinez on May 07, 2021, 04:57:22 pm
Thanks for help!

How could I then confirm the curl command is running? Maybe my problem is in the syntax I am using I have to following filled in in the "update url" field.

curl X PATCH \ -H "Content-Type: application/json" \ -H "Authorization: Bearer KEYHERE" \ -d ' {   "dnsEntry": {     "name": "www",     "expire": 60,     "type": "A",     "content": "%IP%"   }  }  ' \ "ADRESSHERE"

in the logs it says it successfully updates the ip but I think it only updates the cache, I think it is not running the curl command. I tried looking with the packet capture with no success. I can confirm my curl command is working in "Visual Code". so maybe my syntax is wrong for opnsense. sorry I have tried to look for examples of custom dns setups but could not find any examples. How would I convert to an URL?

Again your help is greatly appreciated !
Title: Re: Custom DDNS - How to see the HTTP Response
Post by: Vinez on May 08, 2021, 03:55:42 pm
Few hours later

I am nearly there XD, I have edited the plugins php file to support my provider TransIP the api looks similar to that of DigitalOcean.

/services_dyndns_edit.php: Dynamic DNS Record ID (): PAYLOAD: {"error":"Please supply the 'dnsEntries' parameter"}

That is how far I am now...

something is wrong with my array syntax in the code below:

$hostData = array("data" => "'dnsEntry': {
                                               'name': 'www',
                                               'expire': 60,
                                               'type': 'A',
                                               'content': '$this->_dnsIP' }");

I have tried many things but new to php, maybe you can see or spot the problem?
Title: Re: Custom DDNS - How to see the HTTP Response
Post by: Vinez on May 12, 2021, 02:41:50 pm
All solved now, I can put in a pull request on GitHub if you are interested in adding the ISP TransIP to the list of supported ISP's.
Title: Re: Custom DDNS - How to see the HTTP Response
Post by: Frank on June 28, 2021, 10:56:28 pm
Nice, I'd be interested in that too, as I'm planning to migrate my domains to TransIP soon.

/Frank
Title: Re: Custom DDNS - How to see the HTTP Response
Post by: Benst on July 02, 2021, 12:22:39 pm
All solved now, I can put in a pull request on GitHub if you are interested in adding the ISP TransIP to the list of supported ISP's.

I'm also interested in TransIP ddns support. I did not see a pull request yet. Is your code available somewhere?

Thanks,
Ben