ddns_client 0.8.0 ddns_client: ^0.8.0 copied to clipboard
A library for checking the public internet address and updating a dynamic DNS entry.
Dart library for checking the public internet address and updating a dynamic dns entry.
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
}
});