0

I Have a requirement like the below:

as i have a linux machine with the ip 10.127.0.1 and and tomcat installed on the same machine with the port number 8080 and I am runnning my web application with the name apps1

if i want to access the apps1 application from other machine i have to type http://10.127.0.1:8080/apps1----it workis fine.

But i want to change the entire address (http://10.127.0.1:8080/apps1) into a name like http://myapplicaton.com .so that other can easily access my web application.

Please suggest me how to create a DNS in linux for above requiremets...

Thanks in Advance.

3 Answers3

2

You can't do that with DNS alone.

You would need to set up your DNS to resolve myapplicaton.com to 10.127.0.1 and then run a webserver on port 80 (the default port for HTTP) with a Virtual Name Host that maps onto the resource you actually want (either running your service there instead, or by proxying it).

Quentin
  • 1,157
  • 6
  • 10
0

You need to have that entry in your DNS nameserver. There is nothing you can do at the machine on which you have the tomcat running.

It's like:

  1. Users enters the domain name.
  2. Retrieve the corresponding IP address using the domain name server.
  3. Browser contacts the IP address and connects to port 80 (http).

So, even if you have the domain name registered in nameserver, you will need to run tomcat on port 80.

Abhijeet Rastogi
  • 236
  • 3
  • 20
  • Thanks rastogi..i know i have to keep on running my Tomcat server. I need the configurations where i have to set the Tomcat port number and IP of the machine while creating the DNS? –  Feb 13 '12 at 13:34
0

Add myapplication.com at the end of this line in the file /etc/hosts:

127.0.0.1       localhost.localdomain   localhost

That will make it work on your local computer only.

If you need a real DNS name, you need to buy a domain. This blog has a lot of useful hints on that.

[EDIT] There is no simple way to do what you want.

You need to understand how DNS and the Internet really works. First of all, DNS is a set of world-wide servers which turn names into IP addresses. To take part of this network, you must setup your own DNS server or ask your sysadmin to do so.

After that, you can apply for a domain using one of the many domain resellers. Note that this can be quite expensive if you get it wrong. If in doubt, find someone who buys the domain for you (ask your sysadmin or ISP, for example).

Next, you cannot register an address starting with 10. - these are private addresses which can't be used outside of your local network. So you need to get an official IP address from your ISP, too.

All in all, you should really talk to an expert or spend a couple of days reading up the necessary documentation:

Aaron Digulla
  • 974
  • 3
  • 15
  • 25
  • Thanks for your feedback araon. as the bolg provided its usefull but its not fully eloberated. please can you give me a proper steps to reslove my pblm –  Feb 14 '12 at 04:07