Caddy v2 dns rfc-2136 module


While looking for a way to use rfc-2136 for DNS challenges I found this topic: Rfc2136 provider for caddy v2 - #2 by francislavoie

Unfortunately, I’m a Go noob, but I still wanted to give it a try and check the state of the current module to see what could be missing to use it.

My first attempt was to build caddy with this module but without much luck:

╭─apanel at dev in ~/workspaces/caddy
╰─○ ~/go/bin/xcaddy build --with --with 
023/01/16 08:44:33 [INFO] Temporary folder: /tmp/buildenv_2023-01-16-0844.3218045671
2023/01/16 08:44:33 [INFO] Writing main module: /tmp/buildenv_2023-01-16-0844.3218045671/main.go
package main

import (
        caddycmd ""

        // plug in Caddy modules here
        _ ""
        _ ""
        _ ""

func main() {
2023/01/16 08:44:33 [INFO] Initializing Go module
2023/01/16 08:44:33 [INFO] exec (timeout=10s): /usr/bin/go mod init caddy 
go: creating new go.mod: module caddy
go: to add module requirements and sums:
        go mod tidy
2023/01/16 08:44:33 [INFO] Pinning versions
2023/01/16 08:44:33 [INFO] exec (timeout=0s): /usr/bin/go get -d -v 
go: added v1.0.1
go: added v2.6.2
go: added v0.17.2
go: added v2.1.2
go: added v1.5.1
go: added v0.0.0-20210107165309-348f09dbbbc0
go: added v1.6.0
go: added v1.5.2
go: added v1.3.0
go: added v2.1.1
go: added v0.2.1
go: added v0.29.2
go: added v0.2.1
go: added v0.1.3
go: added v0.1.1
go: added v1.0.1
go: added v1.0.4
go: added v1.1.50
go: added v1.4.8
go: added v1.16.4
go: added v1.12.2
go: added v0.2.0
go: added v0.32.1
go: added v0.7.3
go: added v1.9.0
go: added v1.6.0
go: added v1.23.0
go: added v0.0.0-20220722155217-630584e8d5aa
go: added v0.0.0-20220722155223-a9213eeb770e
go: added v0.6.0-dev.0.20220106191415-9b9b3d81d5e3
go: added v0.0.0-20220812165438-1d4ff48094d1
go: added v0.0.0-20220728004956-3c1f35247d10
go: added v0.0.0-20210927222741-03fcf44c2211
go: added v0.3.8-0.20211004125949-5bd84dd9b33b
go: added v0.1.10
go: added v0.0.0-20220609144429-65e65417b02f
go: added v1.28.0
go: added v1.0.0-20141024135613-dd632973f1e7
2023/01/16 08:44:34 [INFO] exec (timeout=0s): /usr/bin/go get -d -v 
go: downloading v0.0.0-20210212120350-4b5f70325898
**go: parsing go.mod:**
**        module declares its path as:**
**                but was required as:**
2023/01/16 08:44:39 [FATAL] exit status 1

It’s not starting well for a first attempt. I guess I don’t know the trick to build caddy with a plugin that isn’t in the correct namespace ?

Any hints would be welcome :slight_smile:

Kind regards.

EDIT: I’m not sure if it’s the right category to post such questions

Oh sorry. That plugin is incomplete. I never finished it. I should probably archive the repo. I never registered it as a plugin to Download Caddy because it’s not ready.

1 Like

Hello Francis,

Looking at the post I kinda understood it was WIP and as we need it to interact with our PowerDNS servers I thought it would be worth a try to attempt to finish it.

It could be useful to other people needing a way to interact with any other rfc2136 compliant DNS servers.

My first step in was to check how your module prototype behave actually by compiling it with a custom caddy version.

Obviously xcaddy is not the way to go for building caddy with such a module not being registered ?

It is the way, but the code is literally just incomplete, so it won’t compile.

I was just saying that the Download page can generally be used to know whether a plugin is “complete”. They should get registered there by the developer, since it’s a good way to advertise that the plugin exists and is ready to be used.

I agree. But I don’t actually use an RFC2136 DNS server right now, so I didn’t have motivation to finish it.

Ok, thank you for the info Francis.

In the meantime, a colleague pointed me to this repo:

It is NOT listed in the caddy download page, but I gave it a try and it seems to work adding these settings to Caddyfile:

        acme_dns rfc2136 {
                key_name ""
                key_alg "hmac-sha512"
                key "SomeUberSecretTSIGKey=="
                server "x.x.x.x:53"

Reading the code, I don’t understand how it works, maybe most of the code is already in libdns.

Kind regards

1 Like

Yeah, the caddy-dns packages are usually just the config layer/glue for Caddy and the actual functionality is in the libdns package, i.e. GitHub - libdns/rfc2136

This topic was automatically closed after 30 days. New replies are no longer allowed.