Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple? Correct DNS configuration for forwarding to a shared IP 2

Status
Not open for further replies.

sasanchez

IS-IT--Management
Jan 20, 2005
7
US
I think this is a simple configuration but the answer eludes me. I'd appreciate some help.

I need to set up DNS (for newdomain.us) that simply forwards to the primary website (domain.org). Domain.org is on a shared IP so I'm not sure what records should be in the newdomain.us record. Do I use CNAME?

Can someone tell me what the DNS for newdomain.us should look like?

Thanks!
 
I've done that in the past when the IP wasn't shared and it worked fine. Unfortunately, when I go directly to the IP that the first domain resolves as, I get a different site because the site is unsing a shared IP.

At this point I've created a CNAME entry for the new domain that points to the old domain. I'm just not sure about how to handle the reverse PTR record.
 
The PTR record should only point to one of the names, not both.

There is no reason why you can't use regular A records to point both domains to the same IP address. Most web servers handle a number of different sites on the same address.

Chris.

**********************
Chris A.C, CCNA, CCSA
**********************
 
Maybe I'm just misunderstanding. If the first domain is on a shared IP address, how will pointing the second domain to the first domain's shared IP address with an A record work? When I type the IP address into a browser, a totally different site comes up. When a user types the second FQDN into their browser, the A record would point to the first domain's IP address, but the web server wouldn't know which site to serve. What am I missing? Thanks.

 
Are both sites hosted on the same physical web server? You would use host headers (IIS) or virtual hosts (Apache) to determine which site gets served.
 
Which web site comes up is to do with web server configuration, not DNS. DNS only resolves the host name to an IP address. The web server does the rest. As Serbtastic has said, host headers or virtual hosts.



Chris.

**********************
Chris A.C, CCNA, CCSA
**********************
 
Apparently we're still doing something wrong. We've created the 'newdomain.us' DNS record with the following information:

newdomain.us Name Server (NS) host1.attractivemarketing.com
newdomain.us Name Server (NS) host2.attractivemarketing.com
newdomain.us Alias (CNAME) mainsite.org
newdomain.us Host (A) 216.58.139.155
Alias (CNAME) Host (A) 216.58.139.155

Unfortunately, when one enters newdomain.us or into a browser, you are not redirected to mainsite.org (which is on a server located elsewhere).

What are we doing wrong? Thank you for the assistance.
 
You initially said that these two would be on a shared IP (ie. the same server). Now they are on different servers??

If you want to redirect to mainsite.org then you would still have to create a virtual host on a server for but then set up a redirect script to mainsite.org. But again, this is not a DNS issue. It's a web server issue.

Chris.

**********************
Chris A.C, CCNA, CCSA
**********************
 
Sorry for the confusion. newdomain.us is on one server, mainsite.org is on another server and sharing an IP address with other sites.

I have setup forwarding DNS before where the domain A records simply pointed to the main site's IP address, but that was when the site had a dedicated IP address. In this case, pointing newdomain.us to mainsite.org's IP address doesn't work because the host server is using the one IP address for multiple sites.

I was hoping to simply host the newdomain.us DNS record, and point CNAME (or something) to but apparently DNS doesn't work that way.

I think setting up an entire site for newdomain.us with a redirect page to mainsite.org is overkill and should be unnecessary. Isn't there a way to setup a DNS record for a domain that simply points to another site, even if that site is on a shared IP address?

Thanks for the help. I'm stuck.
 
No, DNS does not point to a URL, it resolves an IP address. If you have on a box say on 111.222.33.444 then you would have a record that looks like;

IN A 111.222.333.444

On that server will be set up as a virtual server so when it receives a request for that URL, it knows which site on the box to serve (as requested by the GET request from the remote browser).

Now, if you have the domain newdomain.us on another server (say 1.2.3.4) what you are doing is is trying to make requests for be redirected to by doing the following;

IN CNAME
Why doesn't this work? Think about what happens when I type
So, I enter in my browser. My PC makes a DNS request to my DNS server for this IP address so the server looks up the and finds a CNAME to It then has to look up to find out what the IP address is. It looks it up and finds 111.222.333.444 and returns it to my PC. My browser then connects to 111.222.333.444 and makes a GET request for
The server doesn't have set up as a virtual and so says, sorry this site doesn't exist here. Why would it display when the browser has requested
So, if you really want to show the site for you will either have to do a HTML redirect (which means setting up a virtual on the server to accept requests for or set up a redirect on the server.

This is not something that you do in DNS.

Good luck,

Chris.

**********************
Chris A.C, CCNA, CCSA
**********************
 
Chris, thank you. That has to be the clearest, most helpful post I have ever received. Your explanation makes perfect sense. Guess I'll need to do this on the server.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top