Skip to content

Upgrade to libdns v1.1.1 and adjust tests - #5

Open
jhf wants to merge 2 commits into
libdns:masterfrom
veridit:pr/upgrade-libdns-v1
Open

Upgrade to libdns v1.1.1 and adjust tests#5
jhf wants to merge 2 commits into
libdns:masterfrom
veridit:pr/upgrade-libdns-v1

Conversation

@jhf

@jhf jhf commented Jan 14, 2026

Copy link
Copy Markdown

Summary

Upgrades libdns/namedotcom to work with libdns v1.1.1 (addresses #3)

Changes

  • Upgrade from libdns v0.2.2 to v1.1.1
  • Update to use new Record interface and type-specific records (Address, TXT, CNAME, SRV, CAA)
  • Update test suite to work with new Record interface
  • Bump Go version to 1.25

Credits

Based on the work by @ykarachev in his upgrade PR. Fixed test suite for compatibility with Record interface.

Testing

  • ✅ Package compiles
  • ✅ Tests compile (require environment variables to run)

Resolves #3
Enables: caddy-dns/namedotcom#5

ykarachev and others added 2 commits January 14, 2026 11:02
- Remove manual ID assignment (handled automatically by getRecordId)
- Simplify tests to work with Record interface
- Tests now compile and are ready for libdns v1.1.1
@jhf jhf changed the title Upgrade to libdns v1.1.1 Upgrade to libdns v1.1.1 and adjust tests Jan 14, 2026
@toast-riot

toast-riot commented Jun 15, 2026

Copy link
Copy Markdown

@anderspitman Not sure if you are the correct person to bother with this?
This PR is well overdue, without this merged Caddy + namedns is very impractical to set up.

There's a few other bugs too but I'll make a review for those in a moment.

Sorry to bother you, and much thanks in advance :)

Comment thread namedotcom.go
}

return errors.WithStack(er)
return err

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if err != nil { check guarantees that err will always be nil, so this ends up returning nil which causes a few issues.

Suggested change
return err
return er

Comment thread client.go
return 0, err
}

name := libdns.AbsoluteName(record.RR().Name, zone)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs add a . appended.
The name.com API always returns FQDNs with a trailing ., but libdns.AbsoluteName never does.

Suggested change
name := libdns.AbsoluteName(record.RR().Name, zone)
name := libdns.AbsoluteName(record.RR().Name, zone) + "."

@anderspitman

anderspitman commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

@toast-riot this is the first I'm seeing this PR. Looks like the original author deleted their GH account. I only made one small contribution. Not sure what the policy is here. @mholt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade to libdns 1.0 (currently in beta)

4 participants