Skip to content

libdns/dynu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynu for libdns

Go Reference

This package implements the libdns interfaces for Dynu, allowing you to manage DNS records.

Authenticating

This package uses API Token authentication. Refer to the Dynu documentation for more information.

Start by retrieving your API token (API-Key) from the table on the API Credentials page to be able to make authenticated requests to the API.

OwnDomain field

The field OwnDomain was added to support the Caddy DNS module use case where the DNS zone (e.g. dynu.com) is different from your own (sub)domain in Dynu (e.g. my.dynu.com). Just set it to the root domain in Dynu API, e.g. domainName in the response of /dns/getroot/{hostname} call.

Implementation notes

v0.1.0 of this package relied on the DNS record ID generated by Dynu to function.

Since libdns v1.0.0, the ID field was removed from libdns interface and this package was updated to support operations without the ID. To reduce API calls, the ID field is now moved into a DynuProviderData struct in the ProviderData field of concrete DNS record types.

This change should be transparent. However, it should be noted that when an ID is supplied, at most 1 record will be updated/deleted; when no ID is supplied, Type+Name (for update) and Type+Name+Data (for update) will be used for the search and more than 1 records may be updated/deleted.

A, AAAA, CAA, CNAME, MX, NS, SRV and TXT records returned by this package will have ID information by default. To remove the ID, call the .RR() methods on the returned objects.

Tests

Several tests for the basic functionality of the real Dynu API are available. These tests are not run by default. Set the environment variables TEST_ZONE and TEST_API_TOKEN to enable the tests like so:

TEST_ZONE=example.com. TEST_API_TOKEN=dynu_api_token go test -v

If the tests fail, you can manually check and fix the DNS records on the DDNS Services page.

About

Dynu provider implementation for libdns

Resources

License

Stars

Watchers

Forks

Contributors

Languages