DNS help

Discussion in 'Apache' started by buggyB, Mar 26, 2010.

  1. #1
    Here is what I'm trying to solve. I have two domains, let's say domain1.com and domain2.com hosted on different servers. How do I set the right DNS settings so that if I visit something.domain1.com it will display the contents of domain2.com? They are running on cPanel/WHM BTW. Thank you.

    I know it's not the best section to post this but I don't know where else to categorize this topic, sorry.
     
    buggyB, Mar 26, 2010 IP
  2. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #2
    I think I understand what you are trying to do. You want a subdomain of the first site to show the second site..?

    You could try adding a A record for domain1 that points to domain2, something like this in your zone file for domain1:

    something IN A domain2

    If that is not what you are trying to achieve, then perhaps you should use an iframe to grab the contents of domain2 and display it where you need it.
     
    RHS-Chris, Mar 27, 2010 IP
  3. buggyB

    buggyB Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Could you write a small tutorial for this? I don't want to use redirects, iFrames, etc. Just want to display every file thats on domain2.com to be on something.domain1.com.
    Examples:
    domain2.com/blog ------> something.domain1.com/blog
    domain2.com/mypicture.jpg ------> something.domain1.com/mypicture.jpg
     
    buggyB, Mar 27, 2010 IP
  4. tolra

    tolra Active Member

    Messages:
    515
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    80
    #4
    This only works if BOTH domains use the same nameservers!

    - Login to cPanel on domain2.com
    - Click Parked Domains
    - Enter something.domain1.com and click Add Domain

    Now either something.domain1.com or domain2.com will give the same set of content.

    If the domains are using different nameservers

    - Login to cPanel on domain1.com
    - Click Simple DNS Zone Editor (note if this isn't available you need to ask your host to do the next step for you)
    - In the box Add an A Record enter something.domain1.com and the IP of the server for domain2.com and click Add A Record
    - Login to cPanel on domain2.com
    - Click Parked Domains
    - Enter something.domain1.com and click Add Domain (note this may fail if so ask your host to add it for you)

    Again something.domain1.com and domain2.com should show the same content.
     
    Last edited: Mar 27, 2010
    tolra, Mar 27, 2010 IP