Skip to content

A Dart library for checking the public internet address and updating a dynamic DNS entry.

License

Notifications You must be signed in to change notification settings

danrubel/ddns_client.dart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ddns_client.dart

A Dart library for checking the public internet address and updating a dynamic dns entry.

pub package Build Status

Overview

  • PublicAddressMonitor provides functionality for both a one time check of the public internet address and continuous (periodic) monitoring of the public internet address.

  • DynamicDnsUpdater and its subclasses provide functionality for updating a dynamic dns entry such as those at dyndns.org

Example

A simple example for monitoring an internet address and updating a dyndns.org entry is provided as part of this package.

Monitoring a public internet address:

var monitor = new PublicAddressMonitor();
monitor.startWatching().listen((PublicAddressEvent event) {
  if (event.oldAddress != null &&
      event.oldAddress != event.newAddress) {
    // process changed internet address here
  }
});

Updating a dyndns.org entry:

Dyndns2Updater updater = new Dyndns2Updater(
  username: yourUsername,
  password: yourPassword,
  hostname: yourHostname);
updater.update(newAddress).then((UpdateResult result) {
  if (result.success == true) {
    // success
  } else if (result.success == null) {
    // no change
  } else {
    // failed to update dynamic dns entry
  }
});

About

A Dart library for checking the public internet address and updating a dynamic DNS entry.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages