A server with the specified hostname could not be found

169,095

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:

  1. Your device, Settings/Wi-Fi
  2. Choose connected Wi-Fi pot
  3. Press DHCP/DNS
  4. 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.

Share:
169,095
Zeeshan
Author by

Zeeshan

http://www.zeeshanullah.com/contact.html

Updated on July 08, 2022

Comments

  • Zeeshan
    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
    Paramasivan Samuttiram over 9 years
    Yes, It was 5 minutes for me to get a success.
  • EmbCoder
    EmbCoder over 8 years
    For me, it works fine on simulator but not on device! Will give it a try few minutes later!
  • Sarasranglt
    Sarasranglt over 8 years
    Nailed it at 3.57 min
  • Developer
    Developer over 8 years
    It worked for me but there should be a genuine reason for this issue.
  • bluenowhere
    bluenowhere about 8 years
    Thanks! this fixed my issue... but the same url caused this error in my app worked fine in Safari. Any idea?
  • Kjuly
    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
    bluenowhere about 8 years
    ya the same device ... and the url works in Safari no matter how the DNS gets modified.
  • Kjuly
    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-
    Async- about 7 years
    What kind of answer is that? And it's accepted and upvoted 24 times?
  • Amber K
    Amber K almost 6 years
    Hi 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
    Jamal Zafar almost 6 years
    This was the issue- Saved my time
  • nstein
    nstein over 5 years
    Or keep the App Sandboxing, which is required for the Mac App Store and, simply allow Incoming (Server) and Outgoing (Client) Connections.
  • Alex Chase
    Alex Chase almost 5 years
    This is a bad response.
  • Adam Tucholski
    Adam Tucholski over 4 years
    Well, users really don't like when developers chose this sort of solutions
  • Yogesh Patel
    Yogesh Patel about 4 years
    i can't find this on xcode 11. can you please help me on this. thanks
  • bitkot
    bitkot about 4 years
    I 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
    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
    dewashish over 3 years
    Arguably not a good response, but worked for me. LoL
  • Gilbert Arafat
    Gilbert Arafat over 3 years
    its 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
    rein over 3 years
    This really should be the correct answer.
  • rein
    rein over 3 years
    See Alex Chase's answer below. This is not the correct answer.
  • Lal Krishna
    Lal Krishna about 3 years
    Correct answer is this by Alex Chase
  • Adrienne
    Adrienne about 3 years
    What about for an iOS project?
  • Faruk
    Faruk about 3 years
    absolutely no idea @Aspen
  • KevinF
    KevinF almost 3 years
    It's under the "App Sandbox" capability