Catch bad DNS queries and reduce exception logging
This commit is contained in:
@@ -104,7 +104,14 @@ final class DNS extends BaseProtocol
|
||||
{
|
||||
Log::debug(sprintf('%s:+ DNS Query',self::LOGKEY));
|
||||
|
||||
$this->query = new BaseProtocol\DNS\Query($this->client->read(0,512));
|
||||
try {
|
||||
$this->query = new BaseProtocol\DNS\Query($this->client->read(0,512));
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error(sprintf('%s:! Ignoring bad DNS query (%s)',self::LOGKEY,$e->getMessage()));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Log::info(sprintf('%s:= DNS Query from [%s] for [%s]',self::LOGKEY,$this->client->address_remote,$this->query->domain));
|
||||
|
||||
|
Reference in New Issue
Block a user