Skip to content

Feature request: Export/Import custom hosts and configs. #39

Description

@MagicalDrizzle

The website now persist configs, so I think it would be easier/better to add the ability to import/export custom hostnames/DNS servers/configurations. I think a JSON-type export would be best.

DoHSpeedTest/script.js

Lines 21 to 66 in 576c0ba

// ─── Configuration ───────────────────────────────────────────────────────────
const DEFAULT_TOP_WEBSITES = Object.freeze([
'google.com', 'youtube.com', 'facebook.com', 'instagram.com', 'chatgpt.com',
'x.com', 'whatsapp.com', 'reddit.com', 'wikipedia.org', 'amazon.com',
'tiktok.com', 'pinterest.com'
]);
const TIMEOUT_PENALTY_MS = 5000;
const DNS_MESSAGE_HEADERS = { 'Accept': 'application/dns-message' };
const DNS_JSON_HEADERS = { 'Accept': 'application/dns-json' };
const SETTINGS_STORAGE_KEYS = {
hostnames: 'dns-speed-test-hostnames-v1',
dohServers: 'dns-speed-test-doh-servers-v1'
};
const DEFAULT_DNS_SERVERS = Object.freeze([
{ name: "AdGuard", countryCode: "CY", country: "Cyprus", url: "https://dns.adguard-dns.com/dns-query", ips: ["94.140.14.14", "94.140.15.15"] },
{ name: "AliDNS", countryCode: "CN", country: "China", url: "https://dns.alidns.com/dns-query", ips: ["223.5.5.5", "223.6.6.6"] },
{ name: "OpenDNS", countryCode: "US", country: "United States", url: "https://doh.opendns.com/dns-query", ips: ["208.67.222.222", "208.67.220.220"] },
{ name: "CleanBrowsing", countryCode: "US", country: "United States", url: "https://doh.cleanbrowsing.org/doh/family-filter/", ips: ["185.228.168.9", "185.228.169.9"] },
{ name: "Cloudflare", countryCode: "US", country: "United States", url: "https://cloudflare-dns.com/dns-query", type: "get", allowCors: true, ips: ["1.1.1.1", "1.0.0.1"] },
{ name: "ControlD", countryCode: "CA", country: "Canada", url: "https://freedns.controld.com/p0", ips: ["76.76.2.0", "76.223.122.150"] },
{ name: "DNS.SB", countryCode: "DE", country: "Germany", url: "https://doh.dns.sb/dns-query", type: "get", allowCors: true, ips: ["185.222.222.222", "45.11.45.11"] },
{ name: "DNSPod", countryCode: "CN", country: "China", url: "https://dns.pub/dns-query", type: "post", allowCors: false, ips: ["119.29.29.29", "182.254.116.116"] },
{ name: "Google", countryCode: "US", country: "United States", url: "https://dns.google/resolve", type: "get", allowCors: true, ips: ["8.8.8.8", "8.8.4.4"] },
{ name: "Mullvad", countryCode: "SE", country: "Sweden", url: "https://dns.mullvad.net/dns-query", ips: ["194.242.2.2", "194.242.2.2"], type: "get", allowCors: false },
{ name: "Mullvad Base", countryCode: "SE", country: "Sweden", url: "https://base.dns.mullvad.net/dns-query", ips: ["194.242.2.4", "194.242.2.4"], type: "get", allowCors: false },
{ name: "NextDNS", countryCode: "US", country: "United States", url: "https://dns.nextdns.io", type: "get", ips: ["45.90.28.0", "45.90.30.0"] },
{ name: "OpenBLD", countryCode: "KZ", country: "Kazakhstan", url: "https://ada.openbld.net/dns-query", ips: ["146.112.41.2", "146.112.41.102"], allowCors: false },
{ name: "DNS4EU", countryCode: "CZ", country: "Czechia", url: "https://unfiltered.joindns4.eu/dns-query", ips: ["86.54.11.100", "86.54.11.200"], type: "post", allowCors: false },
{ name: "Quad9", countryCode: "CH", country: "Switzerland", url: "https://dns.quad9.net/dns-query", ips: ["9.9.9.9", "149.112.112.112"] },
{ name: "360", countryCode: "CN", country: "China", url: "https://doh.360.cn/dns-query", ips: ["101.226.4.6", "180.163.224.54"] },
{ name: "Canadian Shield", countryCode: "CA", country: "Canada", url: "https://private.canadianshield.cira.ca/dns-query", ips: ["149.112.121.10", "149.112.122.10"] },
{ name: "Digitale Gesellschaft", countryCode: "CH", country: "Switzerland", url: "https://dns.digitale-gesellschaft.ch/dns-query", ips: ["185.95.218.42", "185.95.218.43"] },
{ name: "DNS for Family", countryCode: "DE", country: "Germany", url: "https://dns-doh.dnsforfamily.com/dns-query", ips: ["94.130.180.225", "78.47.64.161"] },
{ name: "Restena", countryCode: "LU", country: "Luxembourg", url: "https://dnspub.restena.lu/dns-query", ips: ["158.64.1.29"] },
{ name: "IIJ", countryCode: "JP", country: "Japan", url: "https://public.dns.iij.jp/dns-query", ips: ["203.180.164.45", "203.180.166.45"] },
{ name: "LibreDNS", countryCode: "GR", country: "Greece", url: "https://doh.libredns.gr/dns-query", ips: ["116.202.176.26", "147.135.76.183"] },
{ name: "Switch", countryCode: "CH", country: "Switzerland", url: "https://dns.switch.ch/dns-query", ips: ["130.59.31.248", "130.59.31.251"] },
{ name: "Foundation for Applied Privacy", countryCode: "AT", country: "Austria", url: "https://doh.applied-privacy.net/query", ips: ["146.255.56.98"] },
{ name: "UncensoredDNS", countryCode: "DK", country: "Denmark", url: "https://anycast.uncensoreddns.org/dns-query", ips: ["91.239.100.100", "89.233.43.71"] },
{ name: "RethinkDNS", countryCode: "US", country: "United States", url: "https://sky.rethinkdns.com/dns-query", ips: ["104.21.83.62", "172.67.214.246"], allowCors: false },
{ name: "FlashStart (registration required)", countryCode: "IT", country: "Italy", url: "https://doh.flashstart.com/f17c9ee5", type: "post", allowCors: false, ips: ["185.236.104.104"] },
{ name: "Comcast Xfinity", countryCode: "US", country: "United States", url: "https://doh.xfinity.com/dns-query", type: "get", allowCors: false, ips: ["75.75.75.75", "75.75.76.76"] }
]);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions