[Server setup]: CName and A record handling

bhupendra2895

New Member
Messages
554
Reaction score
20
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,
 

aakbar9372

New Member
Messages
6
Reaction score
0
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
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Actually the main question is, how CName works?
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:

bhupendra2895

New Member
Messages
554
Reaction score
20
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:
Top