What if we can add additional metadata and records into mdns standard to make it easier to have a local 'webapp' or search engine.


This is an open idea, so feel free to develop it.

I would like mdns to have the capability for me to create a local web search engine that can do two things targeted for human use:

  • Directory listing of all *.local web server

  • Search capability of searching individual local web servers

What I'm envisioning is that we have two different standards here. So let's split this idea into two parts:

MDNS Human Readable Local Web Server Listings:

If you use

avahi-browse -a -r

You might see something like

+ en0 IPv4 MyPrinter _ipp._tcp local
= en0 IPv4 MyPrinter _ipp._tcp local
   hostname = [myprinter.local]
   address = [192.168.1.45]
   port = 631
   txt = ["note=Office Printer"]
+ en0 IPv4 MyNAS _smb._tcp local
= en0 IPv4 MyNAS _smb._tcp local
   hostname = [mynas.local]
   address = [192.168.1.50]
   port = 445
   txt = ["workgroup=WORKGROUP"]

Often you can jst type myprinter.local and it brings up the printer local web server interface.

But it really doesn't tell you much about it or why you may want to care about it (e.g. kitchen inventory web server).

I'm proposing that we add more record type to allow for encoding these extra information useful for a human rather than machine focused search engine. If we look at what mdns records may look like right now, see below:

= enp6s0 IPv6 Chromecast-lnHsPEJoDHHfvKbdGTa3BUFcp3mhZA3   _googlecast._tcp     local
   hostname = [f81d4fae-7dec-11d0-a765-00a0c91e6bf6.local]
   address = [8856:2245:4553:8:43:3343:3334:2222]
   port = [8009]
   txt = ["rs=Youtube" "rr=lnHsPEJoD" "ct=lnHwedf" "nf=1" "bs=lnHsPEJoD" "st=1" "ca=lnHs" "fn=Living Room TV" "ic=/setup/icon.png" "md=Chromecast" "ve=05" "rm=lnHsPEJoDHHf" "cd=lnHsPEJoDHH

Right now txt records are full of machine focused information... that doesn't really tell you much about it from a human perspective of where to find the 'web site' or a 'thumbnail' or 'visual logo' etc... (or if it's a light bulb... the simple commands you can trigger from a human perspective on it).

We could try cramming more keywords into txt, but it's a bit packed and I would worry about smashing into something important. So maybe let's add new record type like hrd, icon, tags or something (details can be fleshed out with a proper working group). Assuming we go with those, maybe we see something like:

  • txt : still holds machine-readable info (version, author).
  • hrd : human-readable description for discovery interfaces.
  • icon : URL to app/service icon.
  • tags : hashtags for filtering/discovery.
  • url : full web app link.
  • mini_card : optional tiny interactive html iframe for simple controls (lights, speaker volume, toggles).
+ en0 IPv4 WebAppX _http._tcp local
= en0 IPv4 WebAppX _http._tcp local
   hostname = [webappx.local]
   address = [192.168.1.101]
   port = 8080
   txt = ["version=1.4.2", "author=SmartTech Inc."]
   hrd = ["Interactive dashboard for IoT devices, shows live sensor data, supports remote control"]
   icon = ["https://webappx.local/icon.png"]
   tags = ["#IoT", "#Dashboard", "#SmartHome"]

+ en0 IPv4 MusicPlayer _http._tcp local
= en0 IPv4 MusicPlayer _http._tcp local
   hostname = [musicplayer.local]
   address = [192.168.1.102]
   port = 3000
   txt = ["version=2.0.1", "author=AudioLabs"]
   hrd = ["Stream and manage your music library from any device, create playlists, and share"]
   icon = ["https://musicplayer.local/logo.svg"]
   tags = ["#Music", "#Streaming", "#App"]

+ en0 IPv4 SmartLight _http._tcp local
= en0 IPv4 SmartLight _http._tcp local
   hostname = [smartlight.local]
   address = [192.168.1.103]
   port = 5000
   txt = ["version=0.9.8-beta", "author=BrightTech"]
   hrd = ["Control lighting with schedules and moods, supports voice commands"]
   icon = ["https://smartlight.local/light_icon.png"]
   tags = ["#SmartHome", "#Lighting", "#IoT"]
   mini_card = ["https://smartlight.local/card.html"]
   url = ["https://smartlight.local/"]

For a random vibe based render of this concept, below is a chatgpt rendered image of what the user may see:

Local Web Search:

With this local web search system... either we figure out a custom approach where we broadcast a search string and have web servers reply with possible search entries.

Or we can enhance mdns records with a recommended 'search api' location. E.g.

+ en0 IPv4 WebAppX _http._tcp local
= en0 IPv4 WebAppX _http._tcp local
   hostname = [webappx.local]
   address = [192.168.1.101]
   port = 8080
   txt = ["version=1.4.2", "author=SmartTech Inc."]
   hrd = ["Interactive dashboard for IoT devices, shows live sensor data, supports remote control"]
   icon = ["https://webappx.local/icon.png"]
   tags = ["#IoT", "#Dashboard", "#SmartHome"]
   search = [webappx.local?q=<SEARCH_TERM_HERE>]

Where it will discover search point of various webservers... and if the human request something it will ping each endpoint like webappx.local?q=<SEARCH_TERM_HERE> and receive a json/xml/whatever record of various search stuff the user may have wanted.

Not sure how one would deal with security here... as you may not want a NAS to tell on all the possible files you got, but again that's just implementation detail if this idea is explored further. Hopefully the point is taken across.