I turned my pc into router by allowing port forwarding on port 80 and got my hostname(xyz.donexist.org) registered through dyndns.com. Now i when i type my public ip address in browser i get redirected to my browser.

I have installed glassfish and have my website deployed in glassfish. I want that when i type xyz.donexist.org my website should be opened. What all steps more i need to take? I have made a entry in etc/hosts file as :-

If this is the case either change your routers behaviour (if possible) or use one of the many free proxies found on line. I use Hide My Ass not because it's particularly good but because I always remember the name.

First, unless you want to access your site via IP address, you'll need a domain name. The simplest option is to use a service such as DynDNS to forward a third-level domain to your IP address, such as nitesh.dyndns.org. If you would prefer a second-level domain, you'll need to purchase this from a registrar. You can use DynDNS for that too, but I'd instead recommend Go Daddy: their prices are very reasonable and they provide good tools for managing your domains.

Also, unless you've purchased business-class Internet service, there's a good chance your ISP blocks inbound port 80. In that case, you would need to choose a different port to run your web server on, then access the website by navigating to something like http://whatever.example.com:8833/.

Good answer. About blocking port 80: Try out if it's really blocked first. I never heared of ISPs blocking incoming traffic on port 80 - at least here in Germany andother members of the European Union.
–
lajuetteMay 19 '10 at 5:04

But i already registered my domain on dyndns for free. And when i type whatever.example.com i get access to my router. So i don't think it is blocked. However what changes do i need to do to my glassfish because when i visit whatever.example.com i get access to router and not my website.
–
TCMMay 19 '10 at 5:43

You see the router's administration page? It sounds like you've turned on web management. What you want instead is to turn that off then forward port 80 to your computer.
–
Stephen JenningsMay 19 '10 at 14:39

So your PC that's acting as a router is really acting as a NAPT gateway, and port 80 on your router is forwarded to port 8080 (GlassFish's default HTTP service port) on your GlassFish server box? And GlassFish is listening on port 8080 of that box?

If that's the case, then you should be getting a page served from GlassFish when you connect to port 80 on the public IP address of your router and issue an HTTP GET. If you're getting some sort of page served by your router, then port forwarding is not actually working on your router. Do you have some sort of HTTP server software package listening on port 80 on your router? Is it possible that that HTTP server is reserving port 80 and your NAPT gateway code isn't able to override that to forward those connections over to your GlassFish box?

Or maybe you forwarded port 80 to port 80 (instead of 8080), and you've got your OS's built-in HTTP server running on port 80 of the GlassFish box, and when you connect to it and get the default generic "you haven't set up your webserver yet" message, you thought it was coming from the router PC when it was actually coming from the PC you're running GlassFish on?