Ngrok: dial tcp: lookup localhost on 127.0.0.1:53: no such host

Created on 6 Mar 2018  路  6Comments  路  Source: inconshreveable/ngrok

Version 2.2.8

The connection to https://06c1c54b.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:8080.

Make sure that a web service is running on localhost:8080 and that it is a valid address.

The error encountered was: dial tcp: lookup localhost on 127.0.0.1:53: no such host

Most helpful comment

Solved by using 127.0.0.1 instead of localhost

Works
ngrok http 127.0.0.1:8080 -host-header="127.0.0.1:8080"

Doesn't work
ngrok http localhost:8080 -host-header="localhost:8080"

All 6 comments

Solved by using 127.0.0.1 instead of localhost

Works
ngrok http 127.0.0.1:8080 -host-header="127.0.0.1:8080"

Doesn't work
ngrok http localhost:8080 -host-header="localhost:8080"

Make sure this line is included in the hosts file
127.0.0.1 localhost

For MacOS you can find the hosts file here: /etc/hosts

I am using WAMP as my http server. After I installed ngrox I started getting this same error on all my vhosts.

dial tcp4: lookup example.local on 127.0.0.1:53: no such host

My problem was that I had the VPN on.

@jlnarvaez, thanks for the response. I had the same issue and my VPN was on.

@OzanKurt
Problem is : You don't have a localhost named example.local
Solution : add this host name and point it to localhost address
On mac you can do :

  1. open the terminal
  2. sudo vi /etc/hosts
  3. enter password
  4. add this line : 127.0.0.1 example.local (replace the example)
    Done
Was this page helpful?
0 / 5 - 0 ratings

Related issues

shubhamk1997 picture shubhamk1997  路  5Comments

IngwiePhoenix picture IngwiePhoenix  路  7Comments

wujunze picture wujunze  路  9Comments

silverrajat88 picture silverrajat88  路  4Comments

megapctr picture megapctr  路  4Comments