Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There seem to be more questions like this, excuse me if this is similar. I want to redirect to an IP address om my server computer.

This is what I put in my hosts file on the client computer (IMac): dev.dev

It does not resolve to that IP address. Should this normally work, or do I have to do extra things?

(The IP address works in the browser).

share|improve this question
remove the port assignment. Name resolution doesn't concern itself with TCP ports. – jordanm Oct 28 '13 at 1:48
OK, so I will have to type that after the name in the browser – Richard Oct 28 '13 at 1:54
up vote 1 down vote accepted

You do not specify the port in a hosts file. The hosts file expects IP and hostname on each line. Try removing the port, as well as the dot after the IP that I also see in your entry.

e.g.    dev

then try http://dev:8080 in your browser to get to that host:port. You may need to flush the cache on your client computer. From the terminal in OSX 10.6+:

sudo dscacheutil -flushcache
share|improve this answer
Sorry, the dot was a typo, thank you both, that should solve it. I turned the server off now, but I am gonna test it tomorrow. – Richard Oct 28 '13 at 1:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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