godyndns

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

GoDaddy DynDns

License Build and Test Go Report Card

godaddy-dyndns is a simple utility that is basically a DIY dynamic DNS. It checks the current public IP against a GoDaddy domain and, if they don't match, it updates the domain to point to the new IP address.

Installation

Grab the latest release binaries for your OS-architecture from the latest release.

Usage

$ ./godaddy-dyndns -h
godaddy-dyndns

Options:

  -h, --help                               display help information
      --api-key[=$GODADDY_API_KEY]         GoDaddy Api Key
      --secret-key[=$GODADDY_SECRET_KEY]   GoDaddy Secret Key
      --domain[=$GODADDY_DOMAIN]           GoDaddy SubDomain to update. If the subdomain doesn't exist it creates it

Examples

./godaddy-dyndns --api-key=my_godaddy_api_key --secret-key=my_godaddy_secret_key --subdomain=mysubdomain.mikemylonakis.com  # updates the mysubdomain subdomain of mikemylonakis.com
./godaddy-dyndns --api-key=my_godaddy_api_key --secret-key=my_godaddy_secret_key --subdomain=@.mikemylonakis.com            # updates the root domain, i.e. mikemylonakis.com
./godaddy-dyndns --api-key=my_godaddy_api_key --secret-key=my_godaddy_secret_key --subdomain=mikemylonakis.com              # updates the root domain, i.e  mikemylonakis.com

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGodaddyARecordIP added in v1.0.3

func GetGodaddyARecordIP(client *http.Client, domainName string, apiKey, secretKey string) (net.IP, error)

GetGodaddyARecordIP gets the A record associated with the domainName. The domainName param needs to look like : subdomain.domain.com . Upon successful retrieval, it returns the IP address associated with that domain

func GetPublicIP added in v1.0.3

func GetPublicIP(client *http.Client) (net.IP, error)

GetPublicIP Gets the public ip of the current host, assuming that it can reach the internet it accepts an *http.Client as a param mainly for testing purposes

func UpdateGoDaddyARecord

func UpdateGoDaddyARecord(client *http.Client, domainName string, publicIP net.IP, apiKey, secretKey string) error

UpdateGoDaddyARecord updates the A record of a given GoDaddy domain if the public IP that it points to is different compared to the publicIP parameter. The domainName param needs to look like : subdomain.domain.com. The function will then make a REST api call on the domain.com and will update the domain with the publicIP

Types

This section is empty.

Directories

Path Synopsis
cmd
godaddy-dyndns command

Jump to

Keyboard shortcuts

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