Outside DNS setting for pointing to my domain


#1

I have a domain “site1”.
I have a hosting plan from DH (DreamHost).
I set DNS records on “site1” to NSx.dreamhost.com.
I add a domain record for “site1” in DH pointing to “/site1/” folder.
I make a sub domain record “sub.site1” in DH pointing to “/sub/” folder.

Now:
When I type address “site1” I see “site1” content thal locates in /site1/ folder. Site IP xxx.xxx.178.77
Whan I type address “sub.site1” I see site “sub” content.
All working properly. Site IP xxx.xxx.175.77

My friend have domain “site2” (outside DH) with it own DNS.
Than I want to setup my friend’s sub-domain (“sub.site2”) to point to my “sub.site1”.

Main question what I need to do this?

I guess I need to config friends DNS as follows:
sub A xxx.xxx.175.77
or
sub CNAME sub.site1

(Whether will it work?)

Do I need in addition to setup virtual domain in my DH panel and setup DNS settings there?

Thank you for paid attention.


#2

Nobody has any idea?


#3

I think people are having trouble figuring out what you’re suggesting. Your use of “site2” in place of something that looks more like a domain name is confusing at best.

But basically, I think you have to add hosting for your friend’s site: friendsite.tld, you can then add hosting for the subdomain subdomain.friendsite.tld. You at that point, you can go look at the dns records for friendsite.tld and see what IP address DreamHost assigned for subdomain.friendsite.tld. At some point to eliminate any confusion on your part, you should delete hosting for friendsite.tld. Do not delete the domain, just delete the hosting.

DreamHost could potentially assign a different IP address to every one of the domains and subdomains that you host. In practice, you’ll only get a few different ones.

Free unique IP and $67 off with promo code [color=#CC0000]LMIP67[/color] or use [color=#CC0000]LM97[/color] for $97 off. Click for more promo code discounts


#4

I would go with the CNAME approach since the exact IP address may change. This will direct web browers to the right place.

You would also have to configure site2 and sub.site2 as domains on your hosting plan so that the DH web servers know how to serve up pages for those domains. You should be able to make sub.site2 a mirror for sub.site1. You don’t need to change the DNS on DH because it isn’t used in this case.

Larry


#5

Ah, I see that I missed the part where your “friend’s” site is just a mirror of your site. Why can’t it just be a redirect, btw?

Regarding the CNAME method, how does it work given that our domains and subdomains can be different IPs from each other?

(Actually, I was thinking about whether you could add NS records for a subdomain and solve this problem.)

Free unique IP and $67 off with promo code [color=#CC0000]LMIP67[/color] or use [color=#CC0000]LM97[/color] for $97 off. Click for more promo code discounts


#6

Ok.
We change the DNS of frien’s domain to:
sub CNAME sub.site1

And I configure site2 and sub.site2 as domains at DH (just add a domain and set web directory same as for “sub.site1”).

Now NSLOOKUP (in windows) shows same IP address for both “sub.site1” and “sub.site2”. Thats good.

But when I’m typing “sub.site2” in browser I get this:

"Site Temporarily Unavailable
We apologize for the inconvenience. Please contact the webmaster/ tech support immediately to have them rectify this.

error id: “bad_httpd_conf”"


#7

Did you check to make sure that the two sites have both been assigned the same IP address?

BTW, this is why I’m not sure how the CNAME method works. Most of the time, you can never be sure what IP address will be assigned to a new domain or subdomain.

Free unique IP and $67 off with promo code [color=#CC0000]LMIP67[/color] or use [color=#CC0000]LM97[/color] for $97 off. Click for more promo code discounts


#8

Is it important? Generally “sub.site2” is using, but “site2” is just a DH “domain fake”.

But in my case both of it site2 and sub.site2 has same IP.


#9

[quote]Is it important? Generally “sub.site2” is using, but “site2” is just a DH “domain fake”.

But in my case both of it site2 and sub.site2 has same IP.[/quote]
What’s actually important is that the site you listed in the CNAME has the same ip address as the site you’re trying to host. That is, when you put the “sub CNAME sub.site1.tld” in DNS for site2.tld, you have to make sure that sub.site2.tld and sub.site1.tld have the same IP address. Otherwise, you are directing sub.site2.tld to the wrong IP address.

This is why I don’t like the CNAME method. Since you have to manually check to make sure that the IP addresses came out the same, you don’t really gain anything over just putting in a straight A record to the IP address. It just adds to the things that can go wrong. OTOH, I admit there’s a reasonably high probability that the IP addresses match on change and it will save a lilttle time.

Free unique IP and $67 off with promo code [color=#CC0000]LMIP67[/color] or use [color=#CC0000]LM97[/color] for $97 off. Click for more promo code discounts