2020-04-12 20:05:28 +00:00
|
|
|
package constants
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"net"
|
|
|
|
|
|
2020-07-26 12:07:06 +00:00
|
|
|
"github.com/qdm12/gluetun/internal/models"
|
2020-04-12 20:05:28 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
2020-10-20 02:45:28 +00:00
|
|
|
// Cloudflare is a DNS over TLS provider.
|
2020-04-12 20:05:28 +00:00
|
|
|
Cloudflare models.DNSProvider = "cloudflare"
|
2020-10-20 02:45:28 +00:00
|
|
|
// Google is a DNS over TLS provider.
|
2020-04-12 20:05:28 +00:00
|
|
|
Google models.DNSProvider = "google"
|
2020-10-20 02:45:28 +00:00
|
|
|
// Quad9 is a DNS over TLS provider.
|
2020-04-12 20:05:28 +00:00
|
|
|
Quad9 models.DNSProvider = "quad9"
|
2020-10-20 02:45:28 +00:00
|
|
|
// Quadrant is a DNS over TLS provider.
|
2020-04-12 20:05:28 +00:00
|
|
|
Quadrant models.DNSProvider = "quadrant"
|
2020-10-20 02:45:28 +00:00
|
|
|
// CleanBrowsing is a DNS over TLS provider.
|
2020-04-12 20:05:28 +00:00
|
|
|
CleanBrowsing models.DNSProvider = "cleanbrowsing"
|
2020-10-20 02:45:28 +00:00
|
|
|
// SecureDNS is a DNS over TLS provider.
|
2020-04-12 20:05:28 +00:00
|
|
|
SecureDNS models.DNSProvider = "securedns"
|
2020-10-20 02:45:28 +00:00
|
|
|
// LibreDNS is a DNS over TLS provider.
|
2020-04-12 20:05:28 +00:00
|
|
|
LibreDNS models.DNSProvider = "libredns"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// DNSProviderMapping returns a constant mapping of dns provider name
|
|
|
|
|
// to their data such as IP addresses or TLS host name.
|
|
|
|
|
func DNSProviderMapping() map[models.DNSProvider]models.DNSProviderData {
|
|
|
|
|
return map[models.DNSProvider]models.DNSProviderData{
|
|
|
|
|
Cloudflare: {
|
2020-10-20 02:45:28 +00:00
|
|
|
IPs: []net.IP{
|
|
|
|
|
{1, 1, 1, 1},
|
|
|
|
|
{1, 0, 0, 1},
|
|
|
|
|
{0x26, 0x6, 0x47, 0x0, 0x47, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11, 0x11},
|
|
|
|
|
{0x26, 0x6, 0x47, 0x0, 0x47, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x01},
|
|
|
|
|
},
|
2020-04-12 20:05:28 +00:00
|
|
|
SupportsTLS: true,
|
|
|
|
|
SupportsIPv6: true,
|
|
|
|
|
Host: models.DNSHost("cloudflare-dns.com"),
|
|
|
|
|
},
|
|
|
|
|
Google: {
|
2020-10-20 02:45:28 +00:00
|
|
|
IPs: []net.IP{
|
|
|
|
|
{8, 8, 8, 8},
|
|
|
|
|
{8, 8, 4, 4},
|
|
|
|
|
{0x20, 0x1, 0x48, 0x60, 0x48, 0x60, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x88, 0x88},
|
|
|
|
|
{0x20, 0x1, 0x48, 0x60, 0x48, 0x60, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x88, 0x44},
|
|
|
|
|
},
|
2020-04-12 20:05:28 +00:00
|
|
|
SupportsTLS: true,
|
|
|
|
|
SupportsIPv6: true,
|
|
|
|
|
Host: models.DNSHost("dns.google"),
|
|
|
|
|
},
|
|
|
|
|
Quad9: {
|
2020-10-20 02:45:28 +00:00
|
|
|
IPs: []net.IP{
|
|
|
|
|
{9, 9, 9, 9},
|
|
|
|
|
{149, 112, 112, 112},
|
|
|
|
|
{0x26, 0x20, 0x0, 0xfe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfe},
|
|
|
|
|
{0x26, 0x20, 0x0, 0xfe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9},
|
|
|
|
|
},
|
2020-04-12 20:05:28 +00:00
|
|
|
SupportsTLS: true,
|
|
|
|
|
SupportsIPv6: true,
|
|
|
|
|
Host: models.DNSHost("dns.quad9.net"),
|
|
|
|
|
},
|
|
|
|
|
Quadrant: {
|
2020-10-20 02:45:28 +00:00
|
|
|
IPs: []net.IP{
|
|
|
|
|
{12, 159, 2, 159},
|
|
|
|
|
{0x20, 0x1, 0x18, 0x90, 0x14, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x59},
|
|
|
|
|
},
|
2020-04-12 20:05:28 +00:00
|
|
|
SupportsTLS: true,
|
|
|
|
|
SupportsIPv6: true,
|
|
|
|
|
Host: models.DNSHost("dns-tls.qis.io"),
|
|
|
|
|
},
|
|
|
|
|
CleanBrowsing: {
|
2020-10-20 02:45:28 +00:00
|
|
|
IPs: []net.IP{
|
|
|
|
|
{185, 228, 168, 9},
|
|
|
|
|
{185, 228, 169, 9},
|
|
|
|
|
{0x2a, 0xd, 0x2a, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2},
|
|
|
|
|
{0x2a, 0xd, 0x2a, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2},
|
|
|
|
|
},
|
2020-04-12 20:05:28 +00:00
|
|
|
SupportsTLS: true,
|
|
|
|
|
SupportsIPv6: true,
|
|
|
|
|
Host: models.DNSHost("security-filter-dns.cleanbrowsing.org"),
|
|
|
|
|
},
|
|
|
|
|
SecureDNS: {
|
2020-10-20 02:45:28 +00:00
|
|
|
IPs: []net.IP{
|
|
|
|
|
{146, 185, 167, 43},
|
|
|
|
|
{0x2a, 0x3, 0xb0, 0xc0, 0x0, 0x0, 0x10, 0x10, 0x0, 0x0, 0x0, 0x0, 0xe, 0x9a, 0x30, 0x1},
|
|
|
|
|
},
|
2020-04-12 20:05:28 +00:00
|
|
|
SupportsTLS: true,
|
|
|
|
|
SupportsIPv6: true,
|
|
|
|
|
Host: models.DNSHost("dot.securedns.eu"),
|
|
|
|
|
},
|
|
|
|
|
LibreDNS: {
|
|
|
|
|
IPs: []net.IP{{116, 203, 115, 192}},
|
|
|
|
|
SupportsTLS: true,
|
|
|
|
|
Host: models.DNSHost("dot.libredns.gr"),
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Block lists URLs
|
2020-10-20 02:45:28 +00:00
|
|
|
//nolint:lll
|
2020-04-12 20:05:28 +00:00
|
|
|
const (
|
|
|
|
|
AdsBlockListHostnamesURL models.URL = "https://raw.githubusercontent.com/qdm12/files/master/ads-hostnames.updated"
|
|
|
|
|
AdsBlockListIPsURL models.URL = "https://raw.githubusercontent.com/qdm12/files/master/ads-ips.updated"
|
|
|
|
|
MaliciousBlockListHostnamesURL models.URL = "https://raw.githubusercontent.com/qdm12/files/master/malicious-hostnames.updated"
|
|
|
|
|
MaliciousBlockListIPsURL models.URL = "https://raw.githubusercontent.com/qdm12/files/master/malicious-ips.updated"
|
|
|
|
|
SurveillanceBlockListHostnamesURL models.URL = "https://raw.githubusercontent.com/qdm12/files/master/surveillance-hostnames.updated"
|
|
|
|
|
SurveillanceBlockListIPsURL models.URL = "https://raw.githubusercontent.com/qdm12/files/master/surveillance-ips.updated"
|
|
|
|
|
)
|
|
|
|
|
|
2020-10-20 02:45:28 +00:00
|
|
|
// DNS certificates to fetch.
|
|
|
|
|
// TODO obtain from source directly, see qdm12/updated).
|
2020-04-12 20:05:28 +00:00
|
|
|
const (
|
|
|
|
|
NamedRootURL models.URL = "https://raw.githubusercontent.com/qdm12/files/master/named.root.updated"
|
|
|
|
|
RootKeyURL models.URL = "https://raw.githubusercontent.com/qdm12/files/master/root.key.updated"
|
|
|
|
|
)
|