From ee10bba97a1d0cbebea81ee6978559dd076facc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=27rysiek=27=20Wo=C5=BAniak?= Date: Sat, 22 Oct 2022 11:52:38 +0000 Subject: [PATCH] dnslink-fetch: using Hostux DoH JSON API endpoint by default now Thanks to https://hostux.social/@valere: https://hostux.social/@valere/109211704321033926 --- plugins/dnslink-fetch/README.md | 6 ++++-- plugins/dnslink-fetch/index.js | 16 +++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/plugins/dnslink-fetch/README.md b/plugins/dnslink-fetch/README.md index f33a2e4..b6a1454 100644 --- a/plugins/dnslink-fetch/README.md +++ b/plugins/dnslink-fetch/README.md @@ -17,8 +17,10 @@ The `dnslink-fetch` plugin supports the following configuration options: Number of alternative endpoints to attempt fetching from simultaneously. If the number of available alternative endpoints is *lower* then `concurrency`, all are used for each request. If it is *higher*, only `concurrency` of them, chosen at random, are used for any given request. - - `dohProvider` (default: "`https://dns.google/resolve`") - DNS-over-HTTPS JSON API provider/endpoint to query when resolving the DNSLink. By default using Google's DoH provider. Other options: + - `dohProvider` (default: "`https://dns.hostux.net/dns-query`") + DNS-over-HTTPS JSON API provider/endpoint to query when resolving the DNSLink. By default using [Hostux DoH endpoint](https://dns.hostux.net/en/). Other options: + - "`https://dns.google/resolve`" + Google DNS DoH JSON API endpoint - "`https://cloudflare-dns.com/dns-query`" CloudFlare's DoH JSON API endpoint - "`https://mozilla.cloudflare-dns.com/dns-query`" diff --git a/plugins/dnslink-fetch/index.js b/plugins/dnslink-fetch/index.js index 7f105c3..ee891d3 100644 --- a/plugins/dnslink-fetch/index.js +++ b/plugins/dnslink-fetch/index.js @@ -31,10 +31,15 @@ concurrency: 3, // DNS-over-HTTPS JSON API provider - // using Google's DoH provider; other options: - // 'https://cloudflare-dns.com/dns-query' - // 'https://mozilla.cloudflare-dns.com/dns-query' - dohProvider: 'https://dns.google/resolve', + // + // by default using Hostux DoH provider, info here: + // - https://dns.hostux.net/en/ + // + // other known DoH JSON API providers: + // - 'https://cloudflare-dns.com/dns-query' + // - 'https://mozilla.cloudflare-dns.com/dns-query' + // - 'https://dns.google/resolve' + dohProvider: 'https://dns.hostux.net/dns-query', // should the EDNS Client Subnet be masked from authoritative DNS servers for privacy? // - https://en.wikipedia.org/wiki/EDNS_Client_Subnet @@ -109,7 +114,8 @@ } // filter by 'dnslink="/https?/', morph into scheme://... - let re = /^dnslink=\/(https?)\/(.+)/ + // we can't rely on the data not to be wrapped in quotation marks, so we need to correct for that too + let re = /^"?dnslink=\/(https?)\/([^"]+)"?$/ response = response .filter(r => re.test(r)) .map(r => r.replace(re, "$1:\/\/$2"));