protected function resolve($type, $tag)
{
if ($dnsCache = $this->getCache($type, $tag)) {
return $dnsCache['ip'];
} else {
$ec2host = new ec2host(clone $this->ec2, $tag);
if ($ec2host->instances) {
$ip = gethostbyname($ec2host->instances[0]['dnsName']);
$this->setCache($type, $tag, $ip);
return $ip;
} else {
return false;
}
}
}