2017 © Pedro Peláez
 

package manydns

Wrapper for many dynamic DNS providers

image

madbob/manydns

Wrapper for many dynamic DNS providers

  • Monday, July 3, 2017
  • by madbob
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ManyDNS

This package wraps the update API for many different dynamic DNS providers., (*1)

Currently supported providers:, (*2)

  • NoIP https://www.noip.com/
  • ChangeIP http://www.changeip.com/
  • Dynu https://www.dynu.com/
  • DuckDNS https://www.duckdns.org/

Installation

composer require madbob/manydns, (*3)

Usage

require 'vendor/autoload.php';

use ManyDNS\ManyDNS;
use ManyDNS\FailedUpdateException;

/*
    To obtain a list of supported providers
*/
$providers = ManyDNS::getProviders();
foreach($providers as $provider) {
    echo $provider->getName() . "\n";
}

/*
    getProvider() accepts the name of a supported provider, and returns a
    ManyDNS\Client object (or NULL if none is found).
*/
$provider = ManyDNS::getProvider('NoIP');

/*
    To perform a new update of DNS addressing, just call the updateNow()
    function on the preferred client.
    The $ip parameter is optional: most providers accepts the current public IP
    as default, if not the package tries to retrieve the current public IP of
    the instance.
*/
try {
    $provider->updateNow($username, $password, $hostname, $ip);
}
catch (FailedUpdateException $e) {
    /*
        In case of error, FailedUpdateException provides both a human message
        and an error code defined as:
        ManyDNS::ERROR_INVALID_AUTH
        ManyDNS::ERROR_INVALID_HOST
        ManyDNS::ERROR_UNKNOWN
    */
    echo $e->getMessage() . "\n";
    echo $e->getCode() . "\n";
}

Special Behaviors

The DuckDNS authentication is based on a single token, to be used in place of the password when asking for an update., (*4)

$provider = ManyDNS::getProvider('DuckDNS');
$provider->updateNow(null, $token, $hostname, $ip);

The Versions

03/07 2017

dev-master

9999999-dev

Wrapper for many dynamic DNS providers

  Sources   Download

GPL-3.0+

by Roberto Guido

dns dyndns noip changedns dynu

03/07 2017

0.1

0.1.0.0

Wrapper for many dynamic DNS providers

  Sources   Download

GPL-3.0+

by Roberto Guido

dns dyndns noip changedns dynu