Connecting to browse result with name containing "." yields -65540 #8

nevyn opened this Issue Feb 2, 2012 · 3 comments

3 participants


If the name of the found reply contains ".", returns the name up to the dot and no more. Trying to resolve or connect to it fails with -65540.

Not sure if I'm doing something wrong having "." in my name or if it's a bug in dnssd...

puts, reply.type, reply.domain


23.12 Spotify._nuremote._tcp.local.

(pretend that is a valid IP)


Im not sure if I will explain this correctly…

Is the full name ""?

If "" is considered one part of the name the dots should be escaped like "". This is how my domain showed with the old back-to-my-mac, ""

If you don't have control over escaping the name I'll see what I can do to work around it


Sorry, this time with different escaping: 12\.123\.12\.123 and eric\


I've just hit this issue too:

one_service =
two_service =
one_service.register "hereis.myservice", "_testservice._tcp", nil, 8080
two_service.browse("_testservice._tcp") { |b| puts b.inspect }

This fails with ArgumentError: could not construct full service name

The browse reply has:

@name == "hereis"
@type == "myservice._testservice"
@domain == "_tcp.local."

Subsequently passing these values to DNSSD::Service.fullname and on to DNSServiceConstructFullName fails for obvious reasons.

AFAIK the service name can legitimately contain an unescaped dot, and the set_names method on DNSSD::Reply is going to fail when it does, because it does not escape them.

I can patch and submit a PR implementing this if escaping at this stage seems correct? I've only got a passing familiarity with the code and DNSSD in general, so I might have missed something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment