v0.3.5 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2021 License: MIT Imports: 4 Imported by: 0



Package dyndns updates dynamic DNS hostnames. It can be used with services that support the DNS Update API:




This section is empty.


View Source
var (
	NoChange = NewError("nochg", "no settings changed")

	// Account errors.
	ErrAuth    = NewError("badauth", "bad username or password")
	ErrDonator = NewError("!donator", "option available only to credited users")

	// Hostname errors.
	ErrDomain  = NewError("notfqdn", "hostname is not a fully-qualified domain name")
	ErrNoHost  = NewError("nohost", "hostname does not exist in this account")
	ErrNumHost = NewError("numhost", "too many hosts")
	ErrAbuse   = NewError("abuse", "hostname blocked for update abuse")

	// User agent errors.
	ErrAgent = NewError("badagent", "bad user agent or http method")

	// Server errors.
	ErrDns = NewError("dnserror", "dns error")
	Err911 = NewError("911", "server problem or scheduled maintenance")

Update protocol response codes.


View Source
var UserAgent = "go-dyndns"

UserAgent identifies the client in update requests.


This section is empty.


type Error

type Error struct {
	Code, Description string

Update protocol errors.

func NewError

func NewError(code, description string) *Error

NewError returns a new Error from a return code and description.

func (*Error) Error

func (e *Error) Error() string

Error satisfies the built-in error interface.

type Service

type Service struct {
	URL, Username, Password string

A Service represents a dynamic DNS service and its account credentials.

func (Service) Update

func (s Service) Update(hostname string, ip net.IP) (net.IP, error)

Update sends a request to the service to change the hostname to ip. If ip is nil, the update server will use the client's IP address. It returns the updated IP address on success and an error, if any.


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL