Does anyone know if mDNS actually spans between routers?

I am trying to find a way to locate devices in the same local network but I don't know if mDNS will work.

Here is what I mean. Imagine two buildings A and B that have a connection between them. I want to locate all devices in A but I don't want to find devices in B. I could use broadcast but Multicast seems to be a bit more efficient and easy.

I know that link local multicast (the multicast mDNS uses) is subnet specific. However, I think it is reasonable to assume that Buildings A and B could be on the same subnet if they share a common dhcp server. Would that mean that mDNS would span across the two buildings?

Clarification:
I think I need to make myself more clear. I am looking for the best way to allow OpenWRT devices to find each other. The part about 2 buildings is entirely theoretical and is more of a general example.

From what I understand the scope of mDNS is entirely based on the situation. Right now I am looking for a way to find devices that are in the same area. I don't want to find devices in a different building. From what I understand all a network admin has to do is put each area on its own broadcast domain.

My experience here is limited but given no-one else has responded. Presumably due to TZ differences.

I think what one needs is a multicast bridge on your routers if they're actually routers? I've never set one up as I just set a normal DNS record, or get everything on the same layer 2 network. Multicast/broadcast across multiple buildings sounds like a bad idea. An example which I've been frustrated with is when I'm on a campus and I can see every apple TV, google tv and printer in every room in every building at a university......

I did a quick google and it looks like you can also configure multicast filtering on your router(s) I guess?

If you mean "router" as in modem/router/wifi all in ones, but you're operating them in bridge mode (layer 2) then it would go between buildings?

Check avahi reflector.

So without extra software configuration mDNS stays in the same layer 2 network?

What I am trying to figure out the scope of mDNS.

That would be for deliberately forwarding mDNS traffic. What I am trying to figure out is if link local multicast (which mDNS uses) will get forwarded to other buildings. I am looking for a way to find other devices in a single building. I am assuming for all Intents are purposes that each building is in its own layer 2 network.

I think that mDNS has the same scope as broadcast. However, I'm not entirely sure.

Install multi-homed avahi reflector.
multicast is not broadcast, it is in the name.

1 Like

No, because a single DHCP server can serve multiple subnets through DHCP relay agents.

We need more information than this. Are each building served by their own routers? Are they all connected to the same switched Ethernet network? Are there any VLANS? What is the IP addressing plan of these buildings?

Yes, If the devices in buildings A and B are on the same broadcast domain. Very roughly speaking, two devices are on the same broadcast domain if one can send packets to the other without passing through a router.

1 Like

Are you saying that mDNS is restricted to the same broadcast domain?

That's the question I am trying to answer. I did add some clarification so hopefully that helps.

Also thanks for the response

Omg, get over it, there is no broadcast taking place.

I am aware that link local multicast is not broadcast. What I am trying to figure out is if it has the same scope as broadcast.

Will nodes outside the broadcast domain get mDNS packets?

Define broadcast domain?

Layer 2 lan

Subject to igmp snooping on smart(er) switches. Ie subscribers receive messages, not everyone, so not 100% broadcast.

It is exactly zero percent broadcast.

I think I am starting to understand how the actual routing works.

Normally, yes. But you can set up an mDNS reflector, which will "bridge" two or more broadcast domains for mDNS traffic. This isn't enabled by default in OpenWrt. You may need to install a package like avahi then configure accordingly.

1 Like

If the "devices" you'd like to locate are static ones that don't change often, e.g. stationary printers, you might be better off to not use mDNS at all but configure static DNS-SD records for them.

2 Likes