5

mDNS (e.g. avahi, bonjour) allows a machine to advertise itself as machine-name.local on its LAN, and allows clients to look it up by that domain name instead of by IP.

Most platforms support mDNS out of the box, but infamously android doesn't.

i.e. if I want to connect to a service running in my local network through a browser on my android, instead of using machine-name.local:port I'd have to use ip-address:port. This can be frustrating when ip is dynamic and changing.

I'm wondering if I can configure one of the machines as an internal DNS server (e.g. using dnsmasq) which my phone should query for the .local domains. This is possible, but so far what I've found about dnsmasq is that it allows you to set up fixed IPs as aliased to host name only.

I'm wondering -- can my linux machine get the advertised .local addresses and then make them a part of dnsmasq results?

Peeyush Kushwaha
  • 891
  • 7
  • 18
  • I realise this is very late, but as of Android 12, mDNS is supported out of the box. That aside, I tinkered a bit with combining avahi-browse-domains and a python script to generate a hosts file, which dnsmasq in turn would resolve, acting as DNS server. However, I was not able to get my (pre-12) Android device to use my local DNS server, it always used google's nameservers... (as evidenced by running `dig .local ANY` in termux; a `.home` TLD made no difference) – Michd Apr 21 '22 at 12:32
  • ... I _think_this last issue is because Android only wants to resolve DNS queries using DNS over TLS, which can't really be done with a DNS server in the local network, having no domain name that can be externally verified. – Michd Apr 21 '22 at 12:35

0 Answers0