tags:

views:

103

answers:

5

Hi All,

I am developing a web app using Tomcat. I want to give a name like "google" to access my site.(Domain name) How to do that? Thanks

A: 

You need to register a domain name, then set up DNS records (including an A record that points the name to the IP address) on nameservers somewhere, and that IP address has to be accessible from the 'net. You may need web hosting for that, unless you have an always-on internet connection, in which case you need to configure your router to pass through port 80 traffic to the computer running the app.

There are many web hosting companies that will do the name registration and DNS setup and hosting for you if you host the site with them.

T.J. Crowder
Would the downvoter like to provide any constructive criticism?
T.J. Crowder
+2  A: 

I think you need to read up on the Domain Name System (DNS). The RFC is a bit dry so maybe start with wikipedia.

Once you understand the basics it's time to purchase a domain from a registrar and set it up.

Stu Mackellar
A: 
  1. You need some hosting to get your site on the internet
  2. You need to register a domain name and point it at your hosting

Most hosting companies provide both services, which means you don't need to worry about "HOW" you do any of this.

Sohnee
A: 

If you only want to give a fake, temporal domain name for demo purposes on your development computer, you can add a line in your hosts file (typically located in /etc/hosts in UNIX/Linux systems):

# 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

# My fake domain name for demo purposes
192.168.1.121   google.com   

Then, when you open the 'google.com' domain name on your computer, it will redirect you to the specified IP address.

Note that this won't work if you want to access your application from other machines. You would have to make the same change in every computer's hosts file for that to happen.

And obviously, you won't be able to access the real google.com website while having that line in your hosts file.

For Windows systems, the only thing that changes is the location of the hosts file (you must be an Administrator to edit this file):

Windows XP/Vista/Windows7:

c:\windows\system32\drivers\etc\hosts
Sergio Acosta
How to do it in windows?
Manoj
I added the path for Windows systems.
Sergio Acosta
A: 

This is a serverfault.com question. You should point that question there. Anyway T.J.Crowder answer is the one to follow for your purpose.

Dez