Reputation: 1
I am looking to use this api (DnssdServiceInstance to broadcast a mDNS service entry. I have the extremely simple test app in c# (blank console app created in Visual Studio):
using Windows.Networking.ServiceDiscovery.Dnssd;
string InstanceName = "test1";
string SERVICE_TYPE = "_http";
string NETWORK_PROTOCOL = "_tcp";
string DOMAIN = "local";
//string fullServiceName = $"{InstanceName}.{SERVICE_TYPE}.{NETWORK_PROTOCOL}.{DOMAIN}";
string fullServiceName = $"{InstanceName}.{DOMAIN}";
DnssdServiceInstance service = new DnssdServiceInstance(fullServiceName, new("127.0.0.1"), 2222);
Console.ReadLine();
I then try to resolve this address from the same machine using Resolve-DnsName test1.local
in powershell, but have never gotten any result except DNS name does not exist.
I can resolve an mDNS service broadcast by avahi on an Ubuntu WSL instance using the same command, but never anything for the windows service.
Has anyone been able to get the Windows mDNS broadcast api to work?
I have tried defining the service name as both test1.local and test1._http._tcp.local. I have also tried running this code inside of a UWP app with Internet (Client and Server) capabilities requested. No combination I have tried so far has been resolvable.
I would prefer not to use an external dependency if at all possible.
Upvotes: 0
Views: 36
Reputation: 46
Try getting rid of the .local
in your query:
Resolve-DnsName test1
Upvotes: 0