translate DNS queries to avahi-resolve
1# avahi-proxy
2
3This acts as a DNS server listening on a given port (and optional IP, otherwise
4defaulting to `127.0.0.1`) and passes each `A` and `AAAA` query received for
5the `local` domain to `avahi-resolve`.
6If it gets an answer, it passes it back as a proper DNS reply, otherwise
7returning `NXDOMAIN`.
8
9## Compiling
10
11 $ git clone https://github.com/jcs/avahi-proxy
12 $ cd avahi-proxy
13 avahi-proxy$ make
14
15## Installing
16
17 avahi-proxy$ doas make install
18 avahi-proxy$ doas rcctl enable avahi_proxy
19 avahi-proxy$ doas rcctl start avahi_proxy
20
21## Use with `unwind`
22
23When using OpenBSD's `unwind`, configure a `force` block for `local.` and a
24`forwarder` to `avahi-proxy`, assuming its default port of 5300:
25
26 preference { autoconf }
27 forwarder { 127.0.0.1 port 5300 }
28 force forwarder { local }
29
30Now queries for `local.` hosts will forward to `avahi-proxy`, which will proxy
31them to `avahi-resolve`:
32
33 $ dig @127.0.0.1 giraffe.local. a
34 [...]
35 ;; QUESTION SECTION:
36 ;giraffe.local. IN A
37
38 ;; ANSWER SECTION:
39 giraffe.local. 9 IN A 192.168.1.3
40
41To directly query `avahi-daemon`, just supply the port it's running on:
42
43 $ dig @127.0.0.1 -p 5300 giraffe.local. a