translate DNS queries to avahi-resolve
C 94.3%
Makefile 4.7%
Shell 1.0%
2 1 0

Clone this repository

https://tangled.org/jcs.org/avahi-proxy https://tangled.org/did:plc:6ashubrd3ihfmnrpsatviswa/avahi-proxy
git@git.jcs.org:jcs.org/avahi-proxy git@git.jcs.org:did:plc:6ashubrd3ihfmnrpsatviswa/avahi-proxy

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

avahi-proxy#

This acts as a DNS server listening on a given port (and optional IP, otherwise defaulting to 127.0.0.1) and passes each A and AAAA query received for the local domain to avahi-resolve. If it gets an answer, it passes it back as a proper DNS reply, otherwise returning NXDOMAIN.

Compiling#

$ git clone https://github.com/jcs/avahi-proxy
$ cd avahi-proxy
avahi-proxy$ make

Installing#

avahi-proxy$ doas make install
avahi-proxy$ doas rcctl enable avahi_proxy
avahi-proxy$ doas rcctl start avahi_proxy

Use with unwind#

When using OpenBSD's unwind, configure a force block for local. and a forwarder to avahi-proxy, assuming its default port of 5300:

preference { autoconf }
forwarder { 127.0.0.1 port 5300 }
force forwarder { local }

Now queries for local. hosts will forward to avahi-proxy, which will proxy them to avahi-resolve:

$ dig @127.0.0.1 giraffe.local. a
[...]
;; QUESTION SECTION:
;giraffe.local.			IN	A

;; ANSWER SECTION:
giraffe.local.		9	IN	A	192.168.1.3

To directly query avahi-daemon, just supply the port it's running on:

$ dig @127.0.0.1 -p 5300 giraffe.local. a