# "Could not resolve host: github.com" randomly on xcode builds for the last week+

**URL:** <https://travis-ci.community/t/could-not-resolve-host-github-com-randomly-on-xcode-builds-for-the-last-week/5735>\
**Category:** macOS\
**Created:** [October 30, 2019, 12:19pm UTC](https://travis-ci.community/t/could-not-resolve-host-github-com-randomly-on-xcode-builds-for-the-last-week/5735 "2019-10-30T12:19:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RipleyTom](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/ripleytom/32/5638_2.png) [@RipleyTom](https://travis-ci.community/u/RipleyTom)\
**Post date:** [October 30, 2019, 12:19pm UTC](https://travis-ci.community/t/could-not-resolve-host-github-com-randomly-on-xcode-builds-for-the-last-week/5735/1 "2019-10-30T12:19:32Z")

</div>

We’ve recently been having(for 1 and a half week I’d say?) Xcode jobs randomly failing because Travis couldn’t retrieve submodules from github with the error “Could not resolve host: [github.com](http://github.com)”.  
Examples:  
[https://travis-ci.org/RPCS3/rpcs3/jobs/604655095](https://travis-ci.org/RPCS3/rpcs3/jobs/604655095)  
[https://travis-ci.org/RPCS3/rpcs3/jobs/601992121](https://travis-ci.org/RPCS3/rpcs3/jobs/601992121)  
[https://travis-ci.org/RPCS3/rpcs3/jobs/602801836](https://travis-ci.org/RPCS3/rpcs3/jobs/602801836)

This seems to specifically affect Xcode builds(we also do a Linux build with clang on travis and it seems to work fine).

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [October 30, 2019, 12:56pm UTC](https://travis-ci.community/t/could-not-resolve-host-github-com-randomly-on-xcode-builds-for-the-last-week/5735/2 "2019-10-30T12:56:43Z")

</div>

The same happened in the past. I wonder if there’s no DNS cache on the build machines for some reason that’s beyond me.

> [@Intermittent "Could not resolve host" for a well-known host](https://travis-ci.community/t/intermittent-could-not-resolve-host-for-a-well-known-host/2773):
>
> [Getting build failures due to subj](https://travis-ci.org/native-api/opencv-python/jobs/510386524#L3862) (the build was restarted since, link obsolete) occasionally, roughly once every 40-50 jobs (by perception). What puzzles me is that the host that has failed to resolve is homebrew.bintray.com, the same that was used in lots of previous downloads in the same job, so it must be in the local DNS cache. Isn’t it installed in MacOS builders or something, or has a duration shorter than the job time limit?

---

<div class="post-metadata">

**Author:** ![bokov](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/bokov/32/3012_2.png) [@bokov](https://travis-ci.community/u/bokov)\
**Post date:** [November 4, 2019, 7:28pm UTC](https://travis-ci.community/t/could-not-resolve-host-github-com-randomly-on-xcode-builds-for-the-last-week/5735/3 "2019-11-04T19:28:19Z")

</div>

I’m also seeing these errors on MacOS only, but in this case I see them every time I try re-running the latest version of the job so far…

[https://travis-ci.org/bokov/rio/jobs/607215730](https://travis-ci.org/bokov/rio/jobs/607215730)

Examples of hosts that cannot be resolved resulting in test failures:  
[raw.githubusercontent.com](http://raw.githubusercontent.com), goo.gl, [docs.google.com](http://docs.google.com)

Is there some way to force a refresh of the DNS cache or something?

---

<div class="post-metadata">

**Author:** ![bokov](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/bokov/32/3012_2.png) [@bokov](https://travis-ci.community/u/bokov)\
**Post date:** [November 14, 2019, 7:11pm UTC](https://travis-ci.community/t/could-not-resolve-host-github-com-randomly-on-xcode-builds-for-the-last-week/5735/4 "2019-11-14T19:11:57Z")

</div>

Update: when I got rid of `osx_image: xcode8.3` setting and started using Travis’ default xcode, the problems went away.
