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.

Possible Duplicate:
How to use DNS to redirect domain to specific port on my web server

I have a domain xyz.com and a web application running at http://AAA.BBB.CCC.DDD:8080/pcc.

When the user enters the URL xyz.com and www.xyz.com, I want that the page on http://AAA.BBB.CCC.DDD:8080/pcc is displayed in the browser.

What DNS records should I add?

Update:

1) I changed the port to 80.

2) Thanks all for the help!

Now I can reach the application via URLs

www.xyz.com/pcc xyz.com/pcc ,

i. e. xyz.com and www.xyz.com point to AAA.BBB.CCC.DDD.

One last thing remains: I want xyz.com to point to the pcc directory (as well as www.xyz.com).

How can I do that?

share|improve this question

marked as duplicate by Chris S Jan 26 '12 at 14:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Now I changed the port to 80, so that now the target URL is AAA.BBB.CCC.DDD/pcc –  user82180 Jun 12 '11 at 21:40
    
-1 for using the wrong tool for the job and then asking how to get the tool to do the job. This is a HTTP problem. DNS is not the tool for it. –  JdeBP Jun 13 '11 at 16:40
add comment

4 Answers 4

up vote 1 down vote accepted

You need to create an A record for xyz.com that points to AAA.BBB.CCC.DDD. You need to create a CNAME record for www.xyz.com that points to xyz.com.

By default HTTP uses port 80. If you are using apache then you should be able to use mod_proxy to shift the port.

share|improve this answer
    
Now xyz.com and www.xyz.com both point to AAA.BBB.CCC.DDD, and the port is 80 now (see above). I can reach the application using xyz.com/pcc. But how can I make xyz.com point to AAA.BBB.CCC.DDD/pcc (so that I can reach the app via xyz.com) ? TIA –  user82180 Jun 12 '11 at 21:56
    
if you are using Apache then set the DocumentRoot to /path/to/pcc. Servername xyz.com. ServerAlias www.xyz.com. –  Iain Jun 12 '11 at 22:33
add comment

The fact that you have your web site running off of a non-standard port web server breaks the ability of a web browser from reaching it without specifying it port - so "http://xyz.com:8080" work, but "http://xyz.com" will not.

This is not a DNS issue, but an application server setup issue. You need something to respond on port 80 for xyz.com if you want the web browsers to be able to contact it without specifying the non-standard 8080 port.

share|improve this answer
    
"I want xyz.com to point to the pcc directory (as well as www.xyz.com)." Why not just park your web server's web root at the pcc directory? –  user48838 Jun 12 '11 at 22:28
add comment

I use zoneedit.com as my DNS provider. It offers a web forward feature that does this for me. But it does so by answering on port 80 and forwarding to the correct page for me. So user48838 is correct in why this won't work, but there may be an alternative.

share|improve this answer
    
The forwarding service will work. The possible "trick" with this situation is finding one or a combination of to host the xyz.com domain and forward to the non-standard port web server. –  user48838 Jun 12 '11 at 21:19
1  
To be clear: I use zoneedit to forward www.mydomain.com to host.mydomain.com:82/myapp. it works great. No trick (other than to think to do it) –  uSlackr Jun 13 '11 at 0:04
    
I'm in agreement, that does work. There are some pretty "rough" folks that hang out here... –  user48838 Jun 13 '11 at 0:34
add comment

Setup a web browser than can do Rewrites, like Apache, thought hat may be overkill, then add a record:

RewriteRule .* http://aaa.bbb.ccc.ddd:8080/pcc [R=301,L]

To an .htaccess file in your docroot, or in the Apache main httpd.conf file.

share|improve this answer
    
This will work if port 80 is accessible on the machine you are running apache on. –  uSlackr Jun 13 '11 at 0:05
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.