[kgb-maintainers] KGB-1 is changing homes

Martín Ferrari martin.ferrari at gmail.com
Mon Apr 29 15:10:52 UTC 2013


On 29 April 2013 15:39, Damyan Ivanov <dmn at debian.org> wrote:

> The only problem I see is that if a server is offline, the bot has no
> way (currently) to contact others if DNS gives the bad IP.

Not really; if you can ask for all the values of a hostname:

$ perl -MData::Dumper -MSocket -e '
my ($err, @results) = Socket::getaddrinfo(shift, 9999, {
  socktype => Socket::SOCK_STREAM,
  protocol => Socket::PPROTO_TCP
  });
foreach (@results) {
  my ($err, $hostname, $servicename) = Socket::getnameinfo(
    $_->{addr}, Socket::NI_NUMERICHOST);
  $_->{addr} = $hostname;
  print Dumper $_;
}
'  www.debian.org

$VAR1 = {
          'protocol' => 6,
          'canonname' => undef,
          'addr' => '2001:41c8:1000:21::21:4',
          'socktype' => 1,
          'family' => 10
        };
$VAR1 = {
          'protocol' => 6,
          'canonname' => undef,
          'addr' => '2001:610:1908:b000::148:14',
          'socktype' => 1,
          'family' => 10
        };
$VAR1 = {
          'protocol' => 6,
          'canonname' => undef,
          'addr' => '130.89.148.14',
          'socktype' => 1,
          'family' => 2
        };
$VAR1 = {
          'protocol' => 6,
          'canonname' => undef,
          'addr' => '5.153.231.4',
          'socktype' => 1,
          'family' => 2
        };



More information about the kgb-maintainers mailing list