LuckyTurtleDev / crab-hole

🦀 Pi-Hole clone written in rust using hickory-dns/trust-dns

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Split DNS

Empty2k12 opened this issue · comments

I want to forward DNS requests to an upstream based on the domain requested.

Let's assume an organization (mycorp.com) runs authoritative DNS servers for its own domain under dns.mycorp.com (at IP 100.100.100.100). I want to configure crab-hole so that all requests to any subdomain (as deep as necessary) of mycorp.com terminate at dns.mycorp.com, while all other requests go to Cloudflare for example.

See the following example requests:
www.subdomain.mycorp.com -> crab-hole uses dns.mycorp.com as Upstream
test.mycorp.com -> crab-hole uses dns.mycorp.com as Upstream
mycorp.com -> crab-hole uses dns.mycorp.com as Upstream

google.com -> crab-hole uses another configured Upstream
mail.google.com -> crab-hole uses another configured Upstream

Config-wise it could look the following:

[upstream]

[[upstream.name_servers]]
socket_addr = "[2606:4700:4700::1111]:853"
protocol = "tls"
tls_dns_name = "1dot1dot1dot1.cloudflare-dns.com"

[[upstream.name_servers]]
socket_addr = "100.100.100.100:85"
protocol = "udp"
domains = [
    "mycorp.com",
    "mycorp.eu"
]
commented

I don't think this is in scope for this project. Just use this project in conjunction with trust-dns.