A server with the specified hostname could not be found
Solution 1
Keep Trying!
I have had this a few times (including today), and each time, without changing anything, it has worked when I tried again.
Sometimes the 2nd time, other times 20 minutes later.
Solution 2
It might be DNS Pollution issue, at least for my case (in China).
If you're also in China or some places that has DNS Pollution issue, you might solve this by modifying the DNS (to 8.8.8.8
as an example) for your Mac as well.
I got this error inner my iPad App & this happens randomly, it's such boring. Keep trying is not a good solution for me, though it might works somehow. Finally, I just changed my Wi-Fi DNS and no more error now. Steps:
- Your device, Settings/Wi-Fi
- Choose connected Wi-Fi pot
- Press DHCP/DNS
- Set to
8.8.8.8
Solution 3
In Xcode, select Target -> Capabilities, and check "Outgoing Connections (Client)" to enable App Sandbox.
Solution 4
I received A server with the specified hostname could not be found.
. I figured out my MacOS app had turned on App Sandboxing. The easiest way to avoid problem is to turn off Sandbox.
Solution 5
If the problem occured in a MacOS project, as @nstein commented in this answer just go to your Target
's Signing & Capabilities
and allow Incoming
and Outgoing
network options.
Comments
-
Zeeshan almost 2 years
When I try to submit my app on the App Store through Xcode I got this error.
A server with the specified hostname could not be found.
Is this temporary error at Apple or something to do with Xcode?
Is anyone else facing this problem?
-
Paramasivan Samuttiram over 9 yearsYes, It was 5 minutes for me to get a success.
-
EmbCoder over 8 yearsFor me, it works fine on simulator but not on device! Will give it a try few minutes later!
-
Sarasranglt over 8 yearsNailed it at 3.57 min
-
Developer over 8 yearsIt worked for me but there should be a genuine reason for this issue.
-
bluenowhere about 8 yearsThanks! this fixed my issue... but the same url caused this error in my app worked fine in Safari. Any idea?
-
Kjuly about 8 years@ztwei the app & Safari are in same device? not sure about ur issue, it depends, and also, DNS pollution triggers randomly as well, not always.
-
bluenowhere about 8 yearsya the same device ... and the url works in Safari no matter how the DNS gets modified.
-
Kjuly about 8 years@ztwei not sure about it, but Safari might have some tech handles this well, i just search w/ key words "safari, dns" in Google, the first record said "... Apple added a significant new feature to Safari in version 5.0.1. It hasn't garnered much attention and you may not have heard about it. It's called DNS prefetching, and its purpose is to speed up the loading of Web pages." i'm not sure about it, but seems it indeed has some techs inner the app. If u'r also an iOS developer, u should know that we can also support VPN inner app.
-
Async- about 7 yearsWhat kind of answer is that? And it's accepted and upvoted 24 times?
-
Amber K almost 6 yearsHi I am connected to corporate vpn with same credentials and its working fine on simulator but on device even with usb wifi sharing the same error...
-
Jamal Zafar almost 6 yearsThis was the issue- Saved my time
-
nstein over 5 yearsOr keep the App Sandboxing, which is required for the Mac App Store and, simply allow Incoming (Server) and Outgoing (Client) Connections.
-
Alex Chase almost 5 yearsThis is a bad response.
-
Adam Tucholski over 4 yearsWell, users really don't like when developers chose this sort of solutions
-
Yogesh Patel about 4 yearsi can't find this on xcode 11. can you please help me on this. thanks
-
bitkot about 4 yearsI faced the same error when I tried to install macOS Catalina from Software Update. It failed 4 times and then in started downloading.
-
Alex Chase almost 4 years@YogeshPatel the sandbox capability has been moved to the
.entitlements
file in Xcode 11. Check out this answer stackoverflow.com/a/58833674/7003312 -
dewashish over 3 yearsArguably not a good response, but worked for me. LoL
-
Gilbert Arafat over 3 yearsits really work, maybe its just issue on communication to the server update. If it doesn't work, maybe another way is to change the DNS or if you have a dynamic IP connection you can reset your network
-
rein over 3 yearsThis really should be the correct answer.
-
rein over 3 yearsSee Alex Chase's answer below. This is not the correct answer.
-
Lal Krishna about 3 yearsCorrect answer is this by Alex Chase
-
Adrienne about 3 yearsWhat about for an iOS project?
-
Faruk about 3 yearsabsolutely no idea @Aspen
-
KevinF almost 3 yearsIt's under the "App Sandbox" capability