I'm currently writing some POC's where I need to consume a web service from my Mac. I write the web service on my PC and now I need the Mac to be able to consume it for debugging purposes. When working from my home office I have no problems resolving the PC machine name but whenever I get back to the office the browsers (Safari & Chrome) cannot see the PC. The only thing I know is different at work is we're accessing internet via a proxy. Other than that it's a pretty vanilla network setup over DHCP, just like with my home office.
Situation: Mac is set up to file share and can see the PC over SMB Mac can ping the PC successfully when I add ".local" to the PC machine name Mac cannot see the PC from the address line of any browser. PC is set up to run Bonjour print service PC is running the web service over IIS Express PC is set up to support the needed URLs through ...
netsh http add urlacl url=http://*:%HTTP_PORT%/ user=everyone
netsh http add urlacl url=http://localhost:%HTTP_PORT%/ user=everyone
netsh http add urlacl url=http://%COMPUTERNAME%:%HTTP_PORT%/ user=everyone
netsh http add urlacl url=http://%COMPUTERNAME%.local:%HTTP_PORT%/ user=everyone
(%HTTP_PORT% = 60011, default for IIS Express) The above configuration (Bonjour + urlacl) was found at this blog
I wrote a small web method -- HelloWorld -- that just returns "Hello World" for testing purposes and made sure it works locally. Trying to consume it from the Mac via the browsers address field as "http://myPC.local:60011/MyWebService.asmx/HelloWorld" gives me this error (Safari):
Network Error (dns_unresolved_hostname)
Your requested host "myPC.local" could not be resolved by DNS.
("myPC" is just a substitute for the actual machine name)
I'm currently out of ideas. Any suggestions would be greatly appreciated.
Cheers!
[EDIT 1] Not sure if it's a clue to anyone of you Mac gurus out there but: The browsers do react differently if I remove the ".local" in "myPC.local". When I leave it in both Safari and Chrome gives the same exact error message (see above) but when I leave it out Safari returns this message ...
You are not connected to the Internet
... while Chrome returns this ...
Oops!
Google Chrome could not find myPC:60011
[EDIT 2] I've noticed another strange occurance: After having entered the above URL and being served the above error message, it seems to work if I navigate back and then forward again. But if I click 'Refresh' I get the same error message. I have tested this litte trick in Chrome (Safari won't let me navigate back/forward in this situation.
Not sure what to make of that, really! Anyone else willing to give it a shot?
I finally figured out out.
I wronly assumed the DNS servers at work would be able to correctly resolve just the machine name. If I add the fully qualified name ("myPC.") it works fine. Unlike the Mac, other PC's in the same network automatically falls back to employing WINS for name resolution when the AD fails. My home network is a simple workgroup (like the Mac's "local" namespace) so that's why the Mac can successfully employ my home router's DNS service.
It's still a problem of course since configuring the Mac to always make contact with a machine is a specified network makes it impossible to move outside that network (without having to reconfigure).
But, then again, I asked the question not only to crack the problem but to gain some knowledge so it's ok.
Thanks for giving it a shot sivatumma!