Bug fixes and performance improvements

This commit is contained in:
2026-02-24 16:05:02 +01:00
parent da23868817
commit 7d614a2a7e
532 changed files with 639 additions and 523 deletions
+20
View File
@@ -0,0 +1,20 @@
export const DnsService = {
async resolve(hostname: string): Promise<string | null> {
try {
const response = await fetch(
`https://cloudflare-dns.com/dns-query?name=${hostname}&type=A`,
{
headers: { accept: 'application/dns-json' },
credentials: 'omit'
}
);
if (!response.ok) return null;
const data = await response.json();
return data.Answer?.find((r: any) => r.type === 1)?.data || null;
} catch (error) {
return null;
}
}
};