I use mDNS (with avahi, and libnss-mdns) a lot in my home network. However, I've tried to setup Prometheus, and it simply does not care about system resolution, it just takes the name servers from /etc/resolv.conf and does a DNS resolution request to port 53...
Now I was thinking about running a DNS server locally and forwarding the DNS requests to the local mDNS resolution.
In a way, I envisioned something like this
- Prometheus reads the
/etc/resolv.confand one of the nameserver entries is 127.0.0.1- As a part of the lookup it requests
localhostto resolvesomenode.local- After getting the DNS resolve request some service resolves it with mDNS (e.g:
avahi-resolve --name somenode.localand returns the resolved IP- Prometheus receives the IP and works as usual
Are there any tools that can do this already? I'm aware there is dnsmasq, but so far I was not able to find if it can to such things.