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.77k stars 209 forks source link

Support for additional record types in `customDNS.zone` #1587

Closed Terrance closed 2 months ago

Terrance commented 2 months ago

I'm running an internal CalDAV server and exposing its DNS records via Blocky, but ideally this would include a pair of SRV and TXT records and Blocky doesn't support either.

For reference, the records would look like this:

$ORIGIN example.com.
_caldavs._tcp   IN  SRV 0 5 443 cal.example.com.
_caldavs._tcp   IN  TXT "path=/"
_carddavs._tcp  IN  SRV 0 5 443 cal.example.com.
_carddavs._tcp  IN  TXT "path=/"
kwitsch commented 2 months ago

Blocky supports those records through zone file syntax as described in Custom DNS section.

Sorry I miss read your post.

Do I get it correctly that you've tried to set those records in the zone section but they don't actually work?

Terrance commented 2 months ago

The relevant config looks like this:

customDNS:
  zone: |
    $ORIGIN example.com.
    ; ...other names...
    cal         IN  CNAME   box
    box         IN  A   192.168.1.1
    _caldavs._tcp   IN  SRV 0 5 443 cal.example.com.
    _caldavs._tcp   IN  TXT "path=/"
    _carddavs._tcp  IN  SRV 0 5 443 cal.example.com.
    _carddavs._tcp  IN  TXT "path=/"

When queried, no records are returned:

$ dig _caldavs._tcp.example.com srv +noall +answer
(nothing)

And on blocky's stderr:

[2024-08-26 16:26:25] ERROR error on processing request:unsupported customDNS RR type *dns.SRV
client_ip=127.0.0.1 question=*** (_*******._***.*******.***.) req_id=90478e4f-a5d3-49b5-a9a4-07e742619856

This is using blocky 0.24 on Arch Linux.

Terrance commented 2 months ago

This looked easy enough to add support for, so I've opened PR #1588 which seems to work for me.