2017 © Pedro Peláez
 

library dns-srv

image

wdalmut/dns-srv

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Resolve services with SRV records

Use DNS SRV records to resolve services., (*1)

  • select records with minimum priority (as RFC 2782)
  • use a RR algorithm over weights in order to select the right service (as RFC). The RR uses a standard distribution (mean 0, variance 1).
use Corley\Service\Dns;
use Corley\Service\Resolve;

$dns = new Resolve(new Dns());

$config = $dns->resolve("www.corsi.walterdalmut.com");

echo $config["target"]; // 1.corsi.walterdalmut.com
echo $config["port"];   // 80
echo $config["pri"];    // the min priority (1)
echo $config["weight"]; // the rr weight resource (10)

Resolve all

The resolve method returns a single DNS resolution, with resolveAll we can get the list of services with the minimum priority, (*2)

$config = $dns->resolveAll("www.corsi.walterdalmut.com");

var_dump($config); // minimum priority list: [["pri" => 1, ...],[...],[...]]

The Versions

08/05 2016

dev-master

9999999-dev

  Sources   Download

MIT

The Development Requires

08/05 2016

0.0.2

0.0.2.0

  Sources   Download

MIT

The Development Requires

07/05 2016

0.0.1

0.0.1.0

  Sources   Download

MIT

The Development Requires