dstapp/docker-ddns

Trouble trying to use FreeNAS with docker-ddns

develroo opened this issue · 1 comments

OK so I appreciate this project and it fits a need I have to be able to give a FreeNAS server a resolved DNS name on my domain.

So I set up the docker instance and I can test it fine using the provided JSON string.

http://myhost.mydomain.tld:8080/update?secret=changeme&domain=foo&addr=1.2.3.4

That works and a DNS A record is created.

However when I try and set it up from FreeNAS it does not seem to work with the 3 revolvers mentions for standard DynDNS lookups. Namely.

/nic/update
/v2/update
/v3/update

FreeNAS uses inadyn and the config file is such.

    period = 300
    custom customProvider {
    ddns-server = "ns.mydomain.net:8080"
    ddns-path = "/v3/update/"
    ssl = false
    username = "randomuser"
    password = 'SuperSecret'
    hostname = { "myhostname" }
}

However when running the daemon in debug mode I am getting a 404 Error.

 inadyn[2178]: In-a-dyn version 2.5 -- Dynamic DNS update client.
 inadyn[2178]: Resolving hostname myhostname => IP# 127.0.0.1
 inadyn[2178]: Base64 encoded string: YWxsYXN2YXVsdDpMGpGeWxoVWdpSGI0
 inadyn[2178]: Get address for custom
 inadyn[2178]: Checking for IP# change, connecting to checkip.dyndns.org([131.186.161.70]:80)
 inadyn[2178]: Querying DDNS checkip server for my public IP#: GET / HTTP/1.0
 Host: checkip.dyndns.org
 User-Agent: inadyn/2.5 https://github.com/troglobit/inadyn/issues
 
 inadyn[2178]: Server response: HTTP/1.1 200 OK
 Content-Type: text/html
 Server: DynDNS-CheckIP/1.0.1
 Connection: close
 Cache-Control: no-cache
 Pragma: no-cache
 Content-Length: 107
 
 <html><head><title>Current IP Check</title></head><body>Current IP Address: n.n.n.n</body></html>
 inadyn[2178]: Checked my IP, return code 0: OK
 inadyn[2178]: IP server response:
 inadyn[2178]: HTTP/1.1 200 OK
 Content-Type: text/html
 Server: DynDNS-CheckIP/1.0.1
 Connection: close
 Cache-Control: no-cache
 Pragma: no-cache
 Content-Length: 107
 
 <html><head><title>Current IP Check</title></head><body>Current IP Address: n.n.n.n</body></html>
 inadyn[2178]: Checking IPv4 address n.n.n.n ...
 inadyn[2178]: IPv4 address n.n.n.n is valid.
 inadyn[2178]: Current IP# n.n.n.n at custom
 inadyn[2178]: Update forced for alias myhostname, new IP# n.n.n.n
 inadyn[2178]: Sending IP# update to DDNS server, connecting to ns.mydomain.net([y.y.y.y]:8080)
 inadyn[2178]: Sending alias table update to DDNS server: GET /v3/update/myhostname HTTP/1.0
 Host: ns.mydomain.net
 Authorization: Basic YWxsYXN2YXVsdDpMGpGeWxoVWdpSGI0
 User-Agent: inadyn/2.5 https://github.com/troglobit/inadyn/issues
 
 inadyn[2178]: DDNS server response: HTTP/1.0 404 Not Found
 Content-Type: text/plain; charset=utf-8
 X-Content-Type-Options: nosniff
 Date: Fri, 19 Jun 2020 09:44:20 GMT
 Content-Length: 19
 
 404 page not found
 inadyn[2178]: Fatal error in DDNS server response:
 inadyn[2178]: [404 Not Found] 404 page not found
 inadyn[2178]: Error response from DDNS server, exiting!
 inadyn[2178]: Error code 48: DDNS server response not OK

What is odd is I am not even getting any logging back from the server.

I am using docker logs --tail 100 -f dyndns and all I am getting is this:

creating zone...
creating zone file...
creating REST api config...
[ ok ] Starting domain name service...: bind9.
2020/06/18 17:01:26 Serving dyndns REST services on 0.0.0.0:8080...

As I say I have tried all 3 variants above but nothing seems to work? Am I missing something here?

Any insights would be appreciated.

Ok replying to myself because I think I have worked it out. The entire string needed passing so the path in the config has to be:

/nic/update?hostname=

Ok not the most intuitive parameter but no fault of dyndns so. Mea Cupla and please just take this as a reference for others.