diff --git a/src/Handlers/Raw/RawDataResponse.php b/src/Handlers/Raw/RawDataResponse.php index 9bdc513..04c4312 100644 --- a/src/Handlers/Raw/RawDataResponse.php +++ b/src/Handlers/Raw/RawDataResponse.php @@ -215,8 +215,13 @@ function readRecord(): array break; case RecordTypes::TXT: - $strLen = ord($this->readResponse()); - $text = $this->readResponse($strLen); + $totalLength = $headerData['length']; + $text = ''; + do { + $totalLength--; + $strLen = ord($this->readResponse()); + $text .= $this->readResponse($strLen); + } while (strlen($text) < $totalLength); $result['txt'] = DnsUtils::sanitizeRecordTxt($text); break;