Windows – How to unregister a service with dns-sd

bonjourdomain-name-systemnetworkingwindows

I am trying to use "dns-sd" command line tool on my Windows 7 machine.

I can already do something. For example I can register a service using "dns-sd -R …". I also can browser (see) registered services using "dns-sd -B …". What I still miss, is how to unregister a service.

At the moment when I type "dns-sd -R …" the dns-sd does not return me to the command prompt. To return to the command prompt I need to press Ctrl-C. And the service stays registered till I press Ctrl-C.

What I want is to run "dns-sd -R …" in the background regime and then I would like to have a possibility to unregister a service from the command line.

One more thing which I do not understand yet is what "to look up a service" means. In my picture it should be sufficient to register a service, to see it and then to unregister it. But apparently I need to look up a service. What does it mean and why I need to do it?

ADDED:
As it is asked, I clarify. I refer to "dns-sd" command line tool which I use in Windows 7. I think this command is part of Bonjour software for Windows (from Apple). Well, I did not checked if I had this command before I installed Bonjour, but I assume I did not have it. So, my question is about this command.

Best Answer

It's not clear to me exactly what you're trying to accomplish but it sounds like you may be using the wrong tool. dns-sd is a command line testing tool for Multicast DNS and DNS Service Discovery (DNS-SD). The purpose of DNS Service Discovery as the name implies is to advertise network services. The DNS-SD operations are as follows:

Enumerate:

Discover the browse and registration domains configured on the host machine. ".local" will always be returned, Wide-Area domains (eg: example.com) may be available as well:

  • dns-sd -E

Browse:

Browse for service instances (optionally, in a specific domain):

  • dns-sd -B _http._tcp
  • dns-sd -B _http._tcp dns-sd.org

Resolve:

Resolves a service instance (as returned by Browse) to a host and port to connect to along with a text record containing any service specific parameters:

  • dns-sd -L \ *\ Google,\ searching\ the\ Web _http._tcp dns-sd.org

Register:

Registers a service instance so it can be browsed and resolved by other clients browsing a given domain.

  • dns-sd -R Example _http._tcp local 80

Can you be more specific about what is you're trying to accomplish?