Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
24.1 Production Series
»
Dynamic DNS for Porkbun
« previous
next »
Print
Pages: [
1
]
Author
Topic: Dynamic DNS for Porkbun (Read 521 times)
Ph0enix
Newbie
Posts: 6
Karma: 0
Dynamic DNS for Porkbun
«
on:
March 28, 2024, 08:12:20 pm »
I'm trying to configure DDNS for porkbun and some questions came up without a lot of answers on the Internet.
I have `os-ddclient` installed, configuration for `duckdns` and for `Hurricane Electric` works fine, to be fair for both of these I was able to find step-by-step guide how to set it up for OPNSense.
Porkbun has its own API:
https://porkbun.com/api/json/v3/documentation#DNS%20Edit%20Record%20by%20Domain,%20Subdomain%20and%20Type
They also have a script that is deprecated:
https://github.com/porkbundomains/porkbun-dynamic-dns-python/tree/main
I was able to verify that it works by executing a curl that looks like this:
`curl -H "Content-Type: application/json" --request POST -d '{"secretapikey": "sk1_XXX", "apikey": "pk1_XXX", "content": "192.168.0.200"}'
https://porkbun.com/api/json/v3/dns/editByNameType/root.domain/A/sub1.sub2
`
Notice that the domain I want to update looks like `sub1.sub2.root.domain`
Is there a way to make it work with `os-ddclient` somehow?
Eventually I had some success by using `porkbun` service with `ddclient` backend. However if I use more than 1 level of subdomain it considers the rest as root domain and returns an error, e.g. `sub2.root.domain` is not correct. Native `ddclient` has an option `root-domain` but I can't figure out how to set it via OPNSense WebGui. Adding it to `ddclient.conf` manually also did not help, perhaps it did not reload the config though.
Alternatively I thought using `custom` + `Custom POST` would allow me to what I wanted but then I can't figure out how to feed it the data part of the query. Help suggests that I should use the link `https://porkbun.com/api/json/v3/dns/editByNameType/root.domain/A/sub1.sub2` as the `server` but `data` part where I would provide the keys and the content is still a mystery. I tried looking at `/usr/local/etc/ddclient.json` but could not see anything resembling the data part of a `POST` request.
Am I missing something or is the built-in dynamic DNS not flexible enough to accomplish what I need?
Additionally what I'd like to know is if it's possible to use a different gateway to determine the IP address. I have a VPN tunnel, there is a corresponding GW. The GW has an internal wireguard IP. not an exit IP. So if setting the `interface to monitor` to the GW in question would send the quesry for a service like `freedns` through that gateway.
In the end it appears that to accomplish what I want it might be easier to set up docker containers that would sit on different subnets and run the services to update the domains behind my WAN and my WAN_VPN. However having all that running on OPNSense would mean a bit less clutter.
Logged
Monviech
Hero Member
Posts: 1020
Karma: 106
Re: Dynamic DNS for Porkbun
«
Reply #1 on:
March 28, 2024, 08:55:58 pm »
I dont know if it fits your usecase, but os-caddy has porkbun included with dynamic DNS feature. Don't know how well it works though.
Though keep in mind that its just a sub feature of the plugin. Its mostly a reverse proxy.
Logged
Hardware:
DEC740
Ph0enix
Newbie
Posts: 6
Karma: 0
Re: Dynamic DNS for Porkbun
«
Reply #2 on:
March 29, 2024, 12:05:28 am »
Thank you for the pointer. I have not used Caddy yet but that could a good reason to explore.
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
24.1 Production Series
»
Dynamic DNS for Porkbun