nfsn
for libdns
This package implements the libdns interfaces for nearlyfreespeech.net, allowing you to manage DNS records hosted there.
The Provider
requires two pieces of information to operate:
- A
Login
- this is your NFSN login, i.e. the "Login Name" you provide when authenticating against https://members.nearlyfreespeech.net - An
APIKey
- obtained by logging into NFSN, navigating to the 'profile' tab, and selecting 'Manage API Key'. More details on obtaining and managing API keys are available in the NFSN FAQs.
The API that backs SetRecords
only supports A
and AAAA
records. All other record types need to
be deleted and re-created in separate steps.
cli/cli.go
contains a (bare bones) CLI driver for the package. To use it, put an NFSN API key in a
file on disk. By default the tool will look for a file called api_key.txt
in the current working
directory. The -f
argument allows specifying an alternative location and/or filename. The -z
zone argument and the -l
login argument are required for all commands. The CLI tool supports the
following operations in the -o
argument:
GetRecords
retrieves the set of DNS records for the specified zone and prints them to stdout.AddRecord
adds a new record. Takes the-t
type,-n
name, and-d
data arguments.DeleteRecord
deltes a record. Takes the-t
type,-n
name, and-d
data arguments.SetRecord
replaces an existing A or AAAA record transactionally (the API does not support other types of records). Takes the-t
type,-n
name, and-d
data arguments.
Note: these require an NFSN account to access.