Server Fault is a question and answer site for system and network administrators. 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

Using the hosts file, I can't do something like this: testing

Therefore I will have to write testing

in order to do the same thing.

The problem is that I need to be able to access the IP without entering any port. Do I have any options to do such a thing?

share|improve this question
I've removed the DNS tags from this, as port bindings have nothing to do with DNS. DNS is simply a mechanism to get an IP from a name and vice versa. – MDMarra Jun 4 '10 at 12:55

You can set up a reverse proxy to serve at port 80, and forward all requests to 8080.

Apache is one of the web servers that can do this for you. There is a basic reverse proxying example in the mod_proxy documentation.

share|improve this answer

The hosts file only binds host names to IP addresses.

By default HTTP runs over port 80. So by binding a host name to and then hitting the host name in your browser (over HTTP) you are implying port 80.

You would need to set up a proxy server that listened to port 80 and forwarded the requests on to port 8080. Your web server would still have to run on port 8080

share|improve this answer

hosts file is to associate a name to an ip.
What you want to do is a firewall duty.
Or you configure the application to run on 80 instead of 8080.
With iptables you could do something like:

iptables -t nat -I PREROUTING -p tcp -i eth0 -d --dport 8080 -j DNAT --to-destination
share|improve this answer
It would be better to have this administered by the proxy than routing though though IPtables otherwise this just adds an extra level of complexity to the system. Most people would automatically start looking at the web server configs for a proxy if they had to debug an issue or learn how everything is setup. – Paul Jun 4 '10 at 12:58

You need extra privileges to listen on ports below 1000, which is probably why you are listening on port 8080 rather than port 80. You can set up a reverse proxy using Apache, Squid, Varnish or various other proxies.

Or you could just get the software to listen on port 80 by letting it escalate privileges and passing the correct parameters. What's the software? We'll probably be able to help you get it listening on port 80.

share|improve this answer

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.