Giter Site home page Giter Site logo

ipman's Introduction

Mozilla Public License Go Report Card

ipman

Summary

IPman is a simple tool to automatically update DNS records (A and AAAA) based on the external local IPv4 and/or IPv6 address of the local machine. It uses ipify.com for the external address lookup and supports writing records to GoDaddy's DNS API. Both backend providers are modeled as interfaces to allow adding additional backends as needed in the future.

Installing

Users with a proper Go environment (1.8+ required) ...

go get -u github.com/leprechau/ipman

Developers that wish to take advantage of vendoring and other options ...

git clone https://github.com/leprechau/ipman.git
cd ipman
make

Usage

Summary

ahurt$ ipman --help
Usage: ipman [--version] [--help] <command> [<args>]

Available commands are:
    check     Return current external ip address of local machine.
    update    Update DNS registry with external ip address of local machine.

Check Options

Option Description
4 Get external IPv4 address if available.
6 Get external IPv6 address if available.
ipbe IP lookup backend (ipify or local) default: ipify

Update Options

Option Description
4 Get external IPv4 address if available.
6 Get external IPv6 address if available.
key The DNS API access key. May also be set via the IPMAN_DNS_KEY environment variable.
secret The DNS API access secret. May also be set by via the IPMAN_DNS_SECRET environment variable.
domain The DNS domain name. This value defaults to the domain portion of the local hostname.
name The DNS record name. This defaults to the domain root alias ("@").
ttl The DNS record ttl in seconds. This defaults to 600 seconds (5 minutes).
ipbe IP lookup backend (ipify or local). This defaults to ipify.
dnsbe DNS update backend (only godaddy currently). This defaults to godaddy.

Example

ahurt$ ./ipman update -4 -6 -key=YourAccessKey -secret=YourSuperSecretKey
2018/01/18 10:12:35 [IPv4] local/remote 67.187.109.252/67.187.109.252
2018/01/18 10:12:37 [IPv6] local/remote 2601:484:c000:5203:ec4:7aff:feb0:4068/2601:484:c000:5203:ec4:7aff:feb0:4068

The key and secret flags are optional when using environment variables. This will keep your keys from potentially showing up in the system process list. If Updates are required, the local address differs from the remote DNS record, the performed update will be printed.

Crontab (automatic updates)

To dynamically update your records in near real time you can crontab the utillity using something similar to the below in your local users crontab.

## ipman secrets for godaddy api
IPMAN_DNS_KEY=YourAccessKey
IPMAN_DNS_SECRET=YourSuperSecretKey

## check and possibly update dns entries every 30 minutes
*/30 * * * * /path/to/ipman update -4 -6 >/dev/null 2>&1

Please see the crontab documentation of your local system for more information.

ipman's People

Contributors

aaronhurt avatar dcarbone avatar dependabot[bot] avatar megacoder avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.