Open wesleytodd opened 8 years ago
@wesleytodd I can't find any documentation on the difference between service and parent domains. Where did you find info on this?
@wesleytodd I was reading that before but didn't really get that much wiser :wink: Reading it again now I think I interpret it like the following:
<parentdomain>
local.
company-name.com
<servicedomain>
building-12
, orlando-office
or accounting
Is that how you interpret it as well?
yes mostly, but my assumption was that company-name
was intended to be the service domain because otherwise it would be pretty hard to decide if the second part after the .
is the service domain or part of the parent domain. Not that that is necessarily that the spec intends, but that any other way would be hard to parse.
Just re-read this from the RFC:
[...] This leaves 100 bytes to accommodate the organization's existing domain name
<parentdomain>
. When used with Multicast DNS,<parentdomain>
is "local.", which easily fits.
From this I gather that when using DNS-SD together with mDNS, the <parentdomain>
is always local.
. But apparently you can use DNS-SD in non-mDNS environments as well in which case "the organization's existing domain name" will be the <parentdomain>
. And "existing domain" sounds to me like it's company-name.com
, no?
I think the algorithm for detecting this would be something like this:
local.
this will be the <parentdomain>
local.
the <parentdomain>
will include the stuff before the last period as well, e.g. whatever.tld
<servicedomain>
if the part before the <parentdomain>
isn't either _tcp
or _udp
And "existing domain" sounds to me like it's
company-name.com
, no?
Yep, didn't see that part, totally agree. So for something like this _http._tcp.foo.example.com
what do we get? Seems like this would make foo
the service domain?
If the full domain ends in local. this will be the
<parentdomain>
So I tried getting local.
to work, but for some reason only local
worked when I actually registered my services on the network. Not sure why since the spec is pretty clear, but it didnt work for me.
And "existing domain" sounds to me like it's
company-name.com
, no?Yep, didn't see that part, totally agree. So for something like this
_http._tcp.foo.example.com
what do we get? Seems like this would makefoo
the service domain?
Yes
If the full domain ends in local. this will be the
<parentdomain>
So I tried getting
local.
to work, but for some reason onlylocal
worked when I actually registered my services on the network. Not sure why since the spec is pretty clear, but it didnt work for me.
Are you referring to the trailing period after "local"? I've been meaning to debug why that's not working. As you say the RFC is pretty clear on that so it should work. It could be a bug in the multicast-dns module - but for now I've just left it out since that seems to work ok without it.
but for now I've just left it out since that seems to work ok without it
exactly what I did.
Ok, probably this weekened I will take a look at my changes and make sure they incorporate these notes. Thanks!
@wesleytodd I'll hopefully get through my backlog of issues and pull requests over the weekend as well :smile:
Other PR coming your way:
There are three other parts of the dns service name not supported in this module:
Not currently supported:
The changes I was thinking of are as follows:
stringify
should take an object of the form:{instance: <String>, name: <String>, protocol: <String>, subtypes: <Array>, serviceDomain: <String>, parentDomain: <String>}
The subtypes is already a breaking change, so my thought is a 2.0 with this and the subtypes would be a good idea. Thoughts?