The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Point CNAME subdomain to main domain

Discussion in 'General Discussion' started by zer4k, May 13, 2011.

  1. zer4k

    zer4k Registered

    Joined:
    Mar 23, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I need to create a CNAME record like cdn.example.com that points to example.com. I need the following functionality:
    when someone asks for cdn.example.com , the server to return the contents of example.com

    in WHM i entered a new field like this

    cdn 14400 IN CNAME example.com
    (i also tried cdn.example.com)

    unfortunately, when i access cdn.example.com i get the default apache webpage, and not the homepage of example.com

    i know it works if i add cdn.example.com as a parked domain, but i don't want to do it like this, as i think it may involve extra DNS requests when accessing cdn.example.com (pls correct me if i'm wrong on this).

    I think the main issue is being able to point the cdn.example.com CNAME to the root folder of example.com on the server. Is it possible to do this without parking cdn.example.com?

    thanks!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Parked domains do not result in additional DNS requests. A separate DNS Zone is created for the parked domain name, which is used in the same manner the original DNS Zone would be.

    As for the CNAME issue, please ensure you are using a trailing "." after "example.com". EX:

    Code:
    cdn 14400 IN CNAME example.com.
    Thank you.
     
  3. zer4k

    zer4k Registered

    Joined:
    Mar 23, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    yup. i know about the dot :) it's not working.

    what if i create the cdn.example.com subdomain from cpanel and then edit in WHM > Edit DNS Zone and transform the cdn entry from
    cdn ... A IP
    into
    cdn ... CNAME example.com.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)
    That should not be necessary. Could you open a support ticket for this issue so we may see the actual domain used and the entries that have been setup in the DNS Zone?

    Submit A Ticket

    Thank you.
     
Loading...

Share This Page