0xERR0R / blocky

Fast and lightweight DNS proxy as ad-blocker for local network with many features
https://0xERR0R.github.io/blocky/
Apache License 2.0
4.75k stars 209 forks source link

Conditional DNS resolution for wildcards of TLD #1521

Open Tuxdude opened 4 months ago

Tuxdude commented 4 months ago

I would like to specify the upstream DNS server using conditional DNS resolution for a subset of TLDs.

Use Case

I use .foobar as the TLD for all of my devices and services on my internal private network. I have DNS entries on my DNS resolver at 192.168.1.1 which has host -> IP mappings as follows:

host1.foobar 192.168.1.41
host2.foobar 192.168.1.42
host3.foobar 192.168.1.43

I want blocky to resolve any hosts matching *.foobar using an authoritative DNS server in my internal private network which has the above mappings (i.e. basically my DHCP server / router which is currently maintaining these mappings).

What I tried so far

The following does not work:

conditional:
  mapping:
    .foobar: 192.168.1.1

Currently, the above still ends up using the DNS resolvers configured under upstreams. I have more than forty devices in my private network, and I don't want to use Custom DNS to specify each of these host->IP mappings.

From the documentation

The documentation mentions the above should work if my internal domain names were of the form *.foobar.foobaz. I don't see why it should be limited and why it can't be extended to also support *.foobar use case as the one I described above (the one I am using in my private network homelab setup).

conditional:
  mapping:
    foobar.foobaz: 192.168.1.1
github-actions[bot] commented 1 month ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Tuxdude commented 1 month ago

Bumping this for triage by the repo owners and to prevent this issue getting automatically closed.

dajul commented 1 month ago

This is working for me:

conditional:
  fallbackUpstream: false
  mapping:
    freeipa.home: 192.168.88.186,192.168.88.202
    home: 127.0.0.1:5301