Multicast DNS over SoftAP on Win10 IoT
Emily Wong
When I connect my Win10 IoT board to a WiFi, I can connect to its web interface from macOS via . The resolution of the hostname happens through multicast DNS, as can be observed by running dns-sd -q minwinpc.local..
The same behaviour can be observed during onboarding of the Win10 IoT board. In this mode, an access point like AJ_SoftAPSsid is advertised by the board. After connecting to it, once more, dns-sd -q minwinpc.local. resolves to its IP, and access to works fine from macOS.
Things get interesting, though, when I set the Win10 IoT board manually into SoftAP mode, e.g. using a custom UWP app (through Powershell, I haven't found a way to use hostednetwork directly, it seems to only support WiFi Direct).
WiFiDirectAdvertisementPublisher^ p;
p = ref new WiFiDirectAdvertisementPublisher();
p->Advertisement->ListenStateDiscoverability = WiFiDirectAdvertisementListenStateDiscoverability::Intensive;
p->Advertisement->IsAutonomousGroupOwnerEnabled = true;
p->Advertisement->LegacySettings->IsEnabled = true;
p->Advertisement->LegacySettings->Ssid = L"My-SSID";
PasswordCredential^ password = ref new PasswordCredential();
password->Password = L"123456789";
p->Advertisement->LegacySettings->Passphrase = password;
p->Start();I then add the app to the autostart (iotstartup add headless) and reboot.
When I access the device using the normal WiFi, everything still behaves like before. However, when I connect to the custom SoftAP, I can no longer resolve the address, as multicast DNS no longer advertises. Interestingly, if I use a dedicated Windows client (not a VM on a Mac), I can still access both and . According to the MSDN article linked in , this is expected behaviour ([...] In addition, SoftAP does not provide the DNS resolution. [...])
One workaround to get back DNS resolution is to turn on ICS. When I do this from the IoT Windows Device Portal, reboot, and join the SoftAP with macOS, indeed I get 192.168.137.1 (the IoT board) as DNS Server. I also get the search domain mshome.net.
With ICS turned on, behaviour changes in two ways:
• First of all, Unicast DNS seems to work now (Unicast DNS was not working before, neither on the initial AJ_SoftAPSsid WiFi nor on the regular WiFi).
dig minwinpc.local. @192.168.137.1
;; QUESTION SECTION:
;minwinpc.local. IN A
;; ANSWER SECTION:
minwinpc. 0 IN A 192.168.137.1
minwinpc. 0 IN A 172.20.10.7Additionally, minwinpc.mshome.net. is also advertised.
;; QUESTION SECTION:
;minwinpc.mshome.net. IN A
;; ANSWER SECTION:
minwinpc.mshome.net. 0 IN A 192.168.137.1This means that I can now access from macOS. It also means that I can access from Windows in VMware. For both platforms, I can even use because the search domain automatically redirecting it to .
However, the big problem here is that does not work from macOS, the reason being that .local domain is handled via multicast DNS.
• The second change with ICS turned on is regarding multicast DNS. Indeed, dns-sd -q minwinpc.mshome.net. resolves with ICS, but dns-sd -q minwinpc.local. still does not work at all.
When I register my own service with DnssdServiceInstance, though, it gets advertised on domain local., when browsed with dns-sd -B _mycustom._tcp instead of mshome.net..
When I resolve the name assigned to the service using dns-sd -L myname _mycustom._tcp, though, I get the minwinpc.local. domain, though ^_^: myname._mycustom._tcp.local. can be reached at minwinpc.local.:12345 (interface 5).
Which is problematic, because minwinpc.local. is not advertised properly in multicast DNS (minwinpc.mshome.net. is instead), and unicast DNS is not followed by macOS for the local. domain.
Ultimately, it all boils down to this question:
- How can I get local multicast DNS working on the SoftAP interface?
Multicast DNS works fine over the initial AJ_SoftAPSsid onboarding network, and it works fine if I connect the board to the same WiFi as my MacBook. It does not work at all over SoftAP without ICS. With ICS, it advertises on a different domain other than local.
Disclaimer: Please note that all of these steps are kind of flaky with current Win10 IoT. A lot of patience and rebooting is required. Also, the MacBook should not be connected via Ethernet in addition to the WiFi to avoid messing with the resolve process.
4 Reset to default