Feature request for Dynamic DNS REST API

Advanced feature discussion, beta programs and unsupported "Labs" features.
8 posts Page 1 of 1
by dherr » Thu Apr 30, 2015 8:26 am
I just noticed that the TTLs reset to 7200 on the "A" records that I updated via the Dynamic DNS REST API tool.


Obviously you don't want a long TTL for a host that is dynamic. I can live with 7200 but I was trying for 1800, which does not seem excessively low. I did try to at &ttl=1800. It took it without giving an error but it did not set the TTL.

So, not to seem ungrateful for the great tool, I really do love it and will use it as is; but it would be great to add a switch to set our own TTL, or to simply not revert the TTL during updates. If we can't get it then I just have to make sure to go in and lower my TTLs after each dyn dns update (That is a reminder for others that might use this tool.)

P.S. Also noted that the zone SOA does not increment when using the API. The Sonic name servers do pick up the changes so I don't see that as an issue; just something that would make it more "clean" if added.
by kgc » Fri May 01, 2015 3:37 pm
PUT /dyndns/host should take an optional TTL variable now. Let us know how it works.
Kelsey Cummings
System Architect, Sonic.net, Inc.
by dherr » Fri May 01, 2015 3:55 pm
Hey. Thanks much for playing with this...

Maybe I'm doing something wrong here. I have tried it like so:

curl -sX PUT --data "userid=12345&apikey=redacted&hostname=test.wombatz.com&TTL=600&value=" https://public-api.sonic.net/dyndns/host

And tried it at the end:

curl -sX PUT --data "userid=12345&apikey=redacted&hostname=test.wombatz.com&value=" https://public-api.sonic.net/dyndns/host

Both will work to update the IP value but it is still resetting the TTL to the 7200 default. I did just use the members tool to set it to 600 to make sure it would allow the rather low TTL, worked fine so I set it back to 7200.
by dherr » Sun May 03, 2015 7:50 am
Just in case nobody has noticed; the api thingy got wonky are around the same time as this TTL option was worked on. No clue if that is related of course, but it has been going up and down all weekend, as seen with:

7:17-doug@wombat-~/bin>curl -sX GET https://public-api.sonic.net/dyndns/ip <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<title>503 Service Temporarily Unavailable</title>
<h1>Service Temporarily Unavailable</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
<address>Apache/2.2.15 (Scientific Linux) Server at public-api.sonic.net Port 443</address>
by kgc » Tue May 05, 2015 12:48 pm
Needs more monitoring! The apache->hypnotoad proxy seems to run into problems when hypnotoad is restarted.

Meanwhile, I fixed the TTL feature and made a few other changes to the api to make things a little easier. The type and value are optional now and will default to A and the IP of the connecting host and userid is returned when listing keys
Kelsey Cummings
System Architect, Sonic.net, Inc.
by dherr » Tue May 05, 2015 1:19 pm
Wow. You took a simple feature request and took it 3 steps farther. My testing shows it working perfectly. A good tool is now a great tool. Thanks much!
by tquiggle » Mon Feb 08, 2021 6:31 pm

Is there any reason not to just write a stateless update daemon to periodically PUT to


with the hostname in an A record and update it to the current DHCP assignment, regardless of whether it has changed?

If it meaningfully reduces the load on your DNS infrastructure, I can always store the last assignment locally and only PUT when it changes, but hey, laziness is a virtue.

by alexeiser » Sun Apr 18, 2021 3:06 pm
I was able to make the new API work with the lego acme project - however I have found a few issues.

1) Use of _ is not supported in the hostname. so _acme-challenge is not allowed. It can be worked around by using a CNAME but use of _ in any of the hostname is not allowed either. You can set _ urls via Membertools.
2) You can not "delete" a hostname. This is minor, but means that the entries will always be present.

The fork with the sonic specific api is at https://github.com/alexeiser/lego/tree/sonic_api
8 posts Page 1 of 1

Who is online

In total there are 8 users online :: 0 registered, 0 hidden and 8 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 8 guests