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

  1. Prometheus reads the /etc/resolv.conf and one of the nameserver entries is
  2. As a part of the lookup it requests localhost to resolve somenode.local
  3. After getting the DNS resolve request some service resolves it with mDNS (e.g: avahi-resolve --name somenode.local and returns the resolved IP
  4. 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.


1 Answer 1


If you use systemd then it's already available. Here /etc/resolv.conf would point to systemd-resolved and that then uses mDNS and DNS to resolve the request.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .