Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Feb 14 '12 at 12:02

This question came from our site for professional and enthusiast programmers.

3 Answers 3

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).

share|improve this answer
    
Thanks for your inputs Quentin. Please can you give the proper requisites how to create DNS name in linux.? –  user1206852 Feb 13 '12 at 13:39
    
It depends on your DNS server. –  Quentin Feb 13 '12 at 13:45

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.

share|improve this answer
    
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? –  user1206852 Feb 13 '12 at 13:34

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:

share|improve this answer
    
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 –  user1206852 Feb 14 '12 at 4:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.