diff --git a/src/routes/api/internal/diagnostics/dns/+server.ts b/src/routes/api/internal/diagnostics/dns/+server.ts index 09ad742..f07c3e4 100644 --- a/src/routes/api/internal/diagnostics/dns/+server.ts +++ b/src/routes/api/internal/diagnostics/dns/+server.ts @@ -46,7 +46,7 @@ interface IndividualRecord { // DNS over HTTPS endpoints const DOH_ENDPOINTS = { cloudflare: 'https://cloudflare-dns.com/dns-query', - google: 'https://dns.google/dns-query', + google: 'https://dns.google/resolve', quad9: 'https://dns.quad9.net/dns-query', opendns: 'https://doh.opendns.com/dns-query', }; diff --git a/src/routes/diagnostics/dns/propagation/+page.svelte b/src/routes/diagnostics/dns/propagation/+page.svelte index 09c5157..40f3103 100644 --- a/src/routes/diagnostics/dns/propagation/+page.svelte +++ b/src/routes/diagnostics/dns/propagation/+page.svelte @@ -97,9 +97,12 @@ }) as DnsResult[]; if (successfulResults.length === 0) return false; - const firstAnswer = successfulResults[0].result!.Answer!.map((a) => a.data).sort(); + // Cloudflare quotes TXT strings and splits long ones, Google returns them joined + const normalize = (data: string) => + lastQuery?.type === 'TXT' ? data.replace(/^"(.*)"$/, '$1').replace(/" "/g, '') : data; + const firstAnswer = successfulResults[0].result!.Answer!.map((a) => normalize(a.data)).sort(); return successfulResults.every((r) => { - const answers = r.result!.Answer!.map((a) => a.data).sort(); + const answers = r.result!.Answer!.map((a) => normalize(a.data)).sort(); return JSON.stringify(answers) === JSON.stringify(firstAnswer); }); }