# Xenial unable to resolve \`localhost.\` as a valid FQDN

**URL:** <https://travis-ci.community/t/xenial-unable-to-resolve-localhost-as-a-valid-fqdn/919>\
**Category:** Xenial\
**Tags:** xenial\
**Created:** [November 16, 2018, 3:24am UTC](https://travis-ci.community/t/xenial-unable-to-resolve-localhost-as-a-valid-fqdn/919 "2018-11-16T03:24:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SethMichaelLarson](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/sethmichaellarson/32/481_2.png) [@SethMichaelLarson](https://travis-ci.community/u/SethMichaelLarson)\
**Post date:** [November 16, 2018, 3:24am UTC](https://travis-ci.community/t/xenial-unable-to-resolve-localhost-as-a-valid-fqdn/919/1 "2018-11-16T03:24:24Z")

</div>

Travis Xenial with `sudo: required` is unable to resolve `localhost.` as a name.  
This is causing failures on tests for [`urllib3/urllib3`](https://github.com/urllib3/urllib3) while we’re trying to add testing for Python 3.8.

```python
import socket
conn = socket.create_connection(("localhost.", 80)) # Results in a socket.gaierror() when a server is running.

```

See: [https://travis-ci.org/urllib3/urllib3/jobs/455782940](https://travis-ci.org/urllib3/urllib3/jobs/455782940) where all 3 tests that are failing attempt to connect to `localhost.`. All tests pass on Trusty, macOS, and Windows.

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [November 19, 2018, 5:43pm UTC](https://travis-ci.community/t/xenial-unable-to-resolve-localhost-as-a-valid-fqdn/919/2 "2018-11-19T17:43:07Z")

</div>

I tested this, but `localhost.` doesn’t seem to work on Trusty on GCE, either. [https://travis-ci.org/BanzaiMan/travis\_production\_test/jobs/457076700#L471](https://travis-ci.org/BanzaiMan/travis_production_test/jobs/457076700#L471)

Seeing that your other jobs are running with `sudo: false`, I am inclined to think that this is a difference in network configuration between AWS and GCP.

Making `localhost.` work may go beyond our capability (and ask Google to change something). Can your jobs work with `localhost` instead?

---

<div class="post-metadata">

**Author:** ![SethMichaelLarson](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/sethmichaellarson/32/481_2.png) [@SethMichaelLarson](https://travis-ci.community/u/SethMichaelLarson)\
**Post date:** [November 19, 2018, 6:03pm UTC](https://travis-ci.community/t/xenial-unable-to-resolve-localhost-as-a-valid-fqdn/919/3 "2018-11-19T18:03:10Z")

</div>

So all our `localhost` connections work, thing is we’re trying to specifically test the resolution of `localhost.` and it’s effects on the resulting request (Setting the `Host` header to `localhost`, TLS, etc). I suppose we can skip these tests on GCE for now as they’re tested elsewhere. Thanks for the investigative work!
