Jump to content

Improve local app discoverability using DNS or mDNS


LordMike
 Share

Go to solution Solved by ebr,

Recommended Posts

LordMike

Hey,

In my network, I have my emby server running (as others do), but when I set up new apps I need to type in the server name, and port - always. This sucks. It would be awesome to have the apps autodiscover this information - and I have three ways of doing this:

Use an SRV record in the local DNS zone:
SRV records are well known and supported, to help clients discover resources on the network. It would be possible to have a well known name, like:

Quote
Format: _service._proto.name. ttl IN SRV priority weight port target.

_emby._tcp.example.com. 3600 IN SRV 10 10 80 emby.example.com.

Using this, the app would able to look for _emby._tcp at the local DNS zone (get this from the netcard). In return, the client will discover:

  • The servers name (emby.example.com)
  • The servers port (80)

.. thereby saving the user from typing this in.

Unlike mDNS, DNS can be configured by a network administrator to support "odd" scenarios, like if a I had a network where I wanted to use a specific Emby server (on the internet, or some other reachable network) - I could configure this in DNS and have the client apps in my network discover this server - even though it wasn't available locally.

Use an SRV record in mDNS:
mDNS is a DNS system where each participating computer announces itself. Emby Server would be able to join this multicast DNS network, and announce the SRV record from before. Client apps would do the same, and then perform the query in mDNS instead of DNS. The benefit here is that this is likely zero-configuration for an end user. The server will automatically announce itself, and clients can automatically find the server(s) in the network.

This and SRV in DNS is also sometimes called "DNS-SD" for "DNS Service Discovery".

Create a custom UDP broadcast request and response:
Much like multicast DNS, you could send out a custom UDP packet to 255.255.255.255, thereby broadcasting it to the network. The Emby Server could then respond to this, with the server name and port.

This will not work well in IPv6 though.

Mike.

  • Like 1
Link to comment
Share on other sites

  • Solution

Hi.  We already do this via UDP.  Check your firewall to be sure that protocol isn't being blocked.

Link to comment
Share on other sites

Quote

Create a custom UDP broadcast request and response:
Much like multicast DNS, you could send out a custom UDP packet to 255.255.255.255, thereby broadcasting it to the network. The Emby Server could then respond to this, with the server name and port.

Hi, yes this is exactly what we already do.

Link to comment
Share on other sites

LordMike

I really dislike the custom UDP protocol solution, as there already exist protocols to help with this.. 

It likely doesn't work for me, as I run my Emby server within a docker container 😕

 

Would you consider doing the DNS based version? :) 

Link to comment
Share on other sites

13 hours ago, LordMike said:

I really dislike the custom UDP protocol solution, as there already exist protocols to help with this.. 

It likely doesn't work for me, as I run my Emby server within a docker container 😕

 

Would you consider doing the DNS based version? :) 

Do you have the networking mode on the container set to host?

Link to comment
Share on other sites

  • 1 month later...
LordMike

I do not - which is why it won't work. I prefer all my containers to be self-contained and limited, which precludes anything like broadcast-based stuff.

mDNS, broadcasts and similar will also not work across layer 3 VPNs, such as when I connect to my at-home VPN with my iPhone. Here, the iPhone cannot do mDNS and likely not broadcasting stuff either, so here a DNS solution is the only one that will work for service discovery.. :)

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...