cfddns

package module
v0.0.0-...-8213447 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: MIT Imports: 13 Imported by: 0

README

cfddns: a simple ddns update agent for cloudflare

Build

go build -o cfddns ./cmd/cfddns

Usage

Get CF_API_KEY or CF_API_TOKEN from Cloudflare:

https://support.cloudflare.com/hc/en-us/articles/200167836-Managing-API-Tokens-and-Keys

with api key and email
export CF_API_KEY=APIKEY
export CF_API_EMAIL=user@example.com
cfddns --zone example.com --name www
or use token (email can be omitted)
export CF_API_TOKEN=API_TOKEN_FROM_CF
cfddns --zone example.com --name www

It will run as daemon and check/update ip address every minute

Run cfddns --help for more options

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitResolver

func InitResolver(host string)

func LocalIP

func LocalIP(rtype string) (net.IP, error)

LocalIP get local address

func Resolve

func Resolve(host, rtype string) (string, error)

Resolve resolves names top ip address

func Run

func Run()

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client gateway through cloudflare

func NewClient

func NewClient(key, token, email, name string) (*Client, error)

NewClient create the Client

func (*Client) UpdateIPv4

func (c *Client) UpdateIPv4(ctx context.Context, name, address string) error

UpdateIPv4 update ipv4 record for name

func (*Client) UpdateIPv6

func (c *Client) UpdateIPv6(ctx context.Context, name, address string) error

UpdateIPv6 update ipv6 record for name

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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