ngrok icon indicating copy to clipboard operation
ngrok copied to clipboard

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

Open zero-master opened this issue 7 years ago • 8 comments

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

zero-master avatar Mar 06 '18 09:03 zero-master

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"

zero-master avatar Mar 06 '18 12:03 zero-master

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

mohwaili avatar Jul 03 '18 08:07 mohwaili

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

OzanKurt avatar Oct 16 '19 12:10 OzanKurt

My problem was that I had the VPN on.

jlnarvaez avatar Dec 19 '19 10:12 jlnarvaez

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

shanmdphd avatar Mar 13 '20 05:03 shanmdphd

@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

ghost avatar Apr 21 '20 04:04 ghost

guys use localtunnel instead it solved my problem

Gauravpawar3102 avatar Aug 31 '23 19:08 Gauravpawar3102

Work for me: ngrok http 127.0.0.1:5000 --host-header="127.0.0.1:5000"

with two --

profermarquez avatar Nov 08 '23 11:11 profermarquez

Thank you for opening this issue! As of April 2016, the ngrok service has permanently moved to https://ngrok.com/. To join the community and file bug reports or feature enhancements for the ngrok agent, please go to https://github.com/ngrok/ngrok.

This repository is no longer actively maintained and will be archived soon to reduce confusion with the latest ngrok versions. We thank you for the continued support of ngrok and look forward to seeing you over at ngrok.com and the ngrok Community Repo.

russorat avatar May 09 '24 19:05 russorat