0

I added this line to /etc/hosts:

127.0.0.1:8000 myapp.com

But when I access myapp.com from a web browser, it doesn't go to the IP that I listed first. Any idea why?

1 Answer 1

4

The /etc/hosts file is about hosts and their names. It is used when resolving a domain name such as myapp.com to a specific IP address. Howewer, it is not used when choosing which port to connect to; you cannot use host:port in it; the port must always be specified when connecting – i.e. http://myapp.com:8000/ in the browser.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .