mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
fix(dns): retry custom DNS queries over TCP when UDP answer is truncated
Closes #12076
This commit is contained in:
@@ -5,7 +5,6 @@ namespace App\Actions\Shared;
|
||||
use App\Models\Server;
|
||||
use App\Support\DnsRecordHints;
|
||||
use Lorisleiva\Actions\Concerns\AsAction;
|
||||
use PurplePixie\PhpDns\DNSQuery;
|
||||
use PurplePixie\PhpDns\DNSTypes;
|
||||
use Spatie\Url\Url;
|
||||
|
||||
@@ -76,14 +75,9 @@ class CheckDomainDns
|
||||
}
|
||||
|
||||
try {
|
||||
$query = app()->make(DNSQuery::class, [
|
||||
'server' => formatHostForUrl($dnsServer),
|
||||
'port' => 53,
|
||||
'timeout' => min(5, (int) floor($remainingNanoseconds / 1_000_000_000)),
|
||||
]);
|
||||
$records = $query->query($host, $type);
|
||||
$records = queryDnsServer($dnsServer, $host, $type, min(5, (int) floor($remainingNanoseconds / 1_000_000_000)));
|
||||
|
||||
if ($records === false || $query->hasError()) {
|
||||
if ($records === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -361,10 +361,9 @@ class SafeWebhookUrl implements ValidationRule
|
||||
foreach ($dnsServers as $dnsServer) {
|
||||
foreach ([DNSTypes::NAME_A, DNSTypes::NAME_AAAA] as $type) {
|
||||
try {
|
||||
$query = createDnsQuery($dnsServer);
|
||||
$records = $query->query($host, $type);
|
||||
$records = queryDnsServer($dnsServer, $host, $type);
|
||||
|
||||
if ($records === false || $query->hasError()) {
|
||||
if ($records === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user