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
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
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.
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.
Most hosting companies provide both services, which means you don't need to worry about "HOW" you do any of this.
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
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.