1

How do I configure /etc/hosts so that if I go to google.com it's actually routed to my localhost:3000?

I'm aware of similar questions.

Here is what my hosts file looks like right now:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
#127.0.0.1      localhost
255.255.255.255 broadcasthost
::1             localhost
127.0.0.1       myapp.herokuapp.com

You wouldn't believe how many similar questions I've looked up and how many combinations of localhost, 127.0.0.1 and myapp I've tried.

marked as duplicate by Tetsujin, bertieb, n8te, Dave M, music2myear Jun 8 '18 at 17:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

-1

Use your IP address On my computer I would put this in my etc file: 192.168.0.159 google.com

But beware, this will inhibit access to google!

  • 2
    That won't redirect to localhost:3000 (note the port number), which is what OP asked for. – bertieb Jun 8 '18 at 12:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.