[Server setup]: CName and A record handling

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by bhupendra2895, Jan 8, 2011.

  1. bhupendra2895

    bhupendra2895 New Member

    Messages:
    554
    Likes Received:
    20
    Trophy Points:
    0
    Hi,

    I have a site having address example.com and it has a very nice application at /lookup/.
    So I created a sub-domain having address lookup.example.com pointed at /lookup/.

    Now one of my partner site approached me and they want to use my application at the address lookup.domain.com .They didn't want the source code.So I helped them by adding CNAME record like

    l
    ookup.domain.com => lookup.example.com

    But when I open lookup.domain.com, it takes me to the default page of Shared hosting server.

    Is this thing don't work in shared IP/Hosting environment & it will only work if I have dedicated IP?
    Actually the main question is, how CName works?

    Thanks,
     
  2. aakbar9372

    aakbar9372 New Member

    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    I think, If you are using cPanel you should add the new domain and subdomain first. then point your domain to the IP via A record or CNAME.

    CNAME is duplicating the target's hostname/domain IP record. CMIIW
     
  3. misson

    misson Community Paragon Community Support

    Messages:
    2,572
    Likes Received:
    72
    Trophy Points:
    48
    A CNAME record is a canonical hostname. When the browser goes to resolve the hostname "lookup.domain.com", it gets a response saying that "lookup.example.com" is the canonical name. The browser uses the canonical hostname rather than the original to get an IP address (often, the DNS response will also include this address to cut down on network traffic), then creates an HTTP connection to that address. It will send a "Host" HTTP header set to the original hostname when requesting a resource. A shared hosting server uses the "Host:" header to figure out which site to serve. The web server thus needs a ServerAlias configured so that "lookup.domain.com" will be recognized as an alias of "lookup.example.com". Creating a parked domain in cPanel should create the server alias.
     
    Last edited: Jan 8, 2011
  4. bhupendra2895

    bhupendra2895 New Member

    Messages:
    554
    Likes Received:
    20
    Trophy Points:
    0
    Thanks Misson, I resolved this problem by creating a add-on domain that points at the directory where lookup.example.com also points to.Parked domain in my shared hosting service can only be parked to document root not on any other directory/sub-domain , so I need to use add-on domain.
     
    Last edited: Jan 11, 2011

Share This Page