I have a PHP application that must differentiate between different subdomains, and trying to better understand domains and subdomains. When I look at my GoDaddy Zone File, I see the following. This makes me think that my main domain mydomain.com points to 123.45.678, and several other subdomains such as ftp and www point to # which in turn points to my main domain 123.45.678, yet include their respective subdomain. Am I mistaken? I read http://www.webhostingtalk.com/showthread.php?t=470669 which is rather entertaining, however, never concluded the correct interpretation. Thank you
A (Host)
Host Points To
# 123.45.678
CName (Alias)
Host Points To
ftp #
www #
The '#' refers to the origin (your domain name, for example: mydomain.com) in the zone file. All the other records are hosts in that domain. For example 'www.mydomain.com' doesn't refer to a sub-domain, but rather a host in the 'mydomain.com' domain. By stating that they point to # (origin), this means all these 'hosts' are actually the same server. In essence your zone file says that you are running your FTP and web servers on the same physical host. If they were running on different machines, the # in those lines would be replaced by the actual IP addresses of those machines.
TL;DR: the 'www' and 'ftp' entries are hosts in your domain, not sub-domains.
Related
Basicaly it's the same www.domain.com and domain.com, because it's an alias. But, can i create other CNAME like home.domain.com?
And if i put www.domain.com, domain.com and home.domain.com those will show me the same: the main page of the website.
I tried to do that, but when i enter to home, it shows me an error:
https://imgur.com/7AtGAZl
Can a website have multiple CNAMEs?
In case of yes, how many CNAMEs like that can a website have?
Regards.
You need two things:
Update your different subdomains in your dns configuration pointing to your server's IP address.
Create virtual hosts in your webserver if it's apache or search for the equivalent if you use another one.
To emulate the first one you can edit your hosts file adding the different subdomains pointing at your ip and this way check that your Virtual Hosts are working.
Are there any free dns services i can use to access my local host over external ip that support wildcard domains? This way i can set up virtual hosts to serve the subdomain content based on subdomain name.
For example, suppose the free fqdn with dns service is:
example.com
Example.com - my server root, default vhost
Site1.example.com - loads site1 vhost
Site2.example.com - loads site2 vhost
*.example.com - i can create a vhost for whatever the wildcard value is and it'll work like the two above
I don't mind if the free fqdn is a top level domain. Example.aa.bb.cc is fine as long as i can set up *.example.aa.bb.cc
A free fqdn/dns without support for wildcard subdomains but has lots of free subdomains i could set up would be OK, but not preferred.
Also, dynamic dns is not a requirement. My external ip very rarely changes so i wouldn't mind updating it if it ever changes.
I know I'm asking for a lot for free. I don't mind buying a domain name but I'm trying to get away with free if i can.
You should consider to build your own domain server to handle the subdomain information, for example using Bind software. After that you need to submit your NS record to your domain register
Found a good one. dtdns.com is free and allows for wildcard subdomains for free.
I'm hosting a clients site at client.mysite.com, but my client want to have its own domain, like www.clientsite.com.
With a CNAME configuration, I'll be able to hook my client domain to the content, but... considering I'm still hosting my clients content, which domain will be finally listed on Google with contents of client.mysite.com contents?
a) mysite.com
b) clientsite.com
Thanks for helping.
In the DNS hierarchy, the CNAME resource record will be attached to the clientside.com. A CNAME is simply a reference to the location of that site's A record. With that in mind, I believe mysite.com will be listed as hosting the data.
Does your client want it to appear under his name?
If so, then this should not be solved using DNS (well, not only using DNS).
If your client wants to get the content listed under his domain name, the best way to do this, is to add their name to your server.
Then point client domain name to your server.
The best way to do the pointing (when also considering SEO)
is to make an webforward (301 permanent) from the root, to the www
and make the www subdomain point to the ressource.
(Or vice verca)
IF you are using the example above (webforward on root) you can use a cname instead of an A record to point the domain name. However do not add a cname to the root of a domain (effectively shutting down your domain name).
So-
Short Answer:
client.mysite.com will have the content (also according to google).
Any attempt to obfuscate this is black hat or grey hat ;)
a better way of doing it is to simply setup the clients domain name on your server.
Then point only one hostname to the server. Server host/headers will take care of the rest.
Setup in DNS
# webforward 301 www
www a or Cname to server
Quick rules:
NEVER put Cname on the root of a domain
Only allow 1 hostname to show content (can be done both as explained above via DNS/webforward or via server configurations)
I have a dedicated linux hosting machine from godaddy. I also have purchased two website domains. Say it is abc.com and xyz.com.
xyz.com is already setup to the server.
I want to get abc.com's traffic to a subfolder of xyz.com but the links must remain as abc.com. i.e abc.com/index.html must be in xyz.com/abc/index.html path. But xyz.com/abc/index.html must return a 404 while abc.com/index.html must return the proper page.
If you are using apache with mod_proxy enabled, configuring a ReverseProxy will do the job. This is an example of the directives to add in abc.com domain's apache configuration:
ProxyPass / http://xyz.com/subfoder
ProxyPassReverse / http://xyz.com/subfolder
These will forward all requests to http://xyz.com/subfoder`
Also have a look to apache's documentation
Under my domain, one of the subdomain must be directed to one server that hosts the relevant applications, and the rest must be directed to another server that hosts the relavant applications.
So, any requests to the url appa.example.com\* must be directed to one server, and any requests to the url appb.example.com\* must be directed to another server.
The issue now is how to configure the Apache configuration on both servers-- maybe using configuration like ProxyPass or ProxyPassReverse so that they all the incoming requests can be directed correctly at the correct server?
Edit to make the question clearer.
The place to link an url to an IP (server) is the DNS.
For example if server A is at 1.2.3.4 and server B at 5.6.7.8 you link appa.example.com to 1.2.3.4 and appb.example.com to 5.6.7.8.
But if both servers are behind a firewall (with a single external IP address) you have to perform some tricks. (And you are probably looking for these tricks).
Have a look at An Introduction to Redirecting URLs on an Apache Server.
I've done the same thing for my workplace (a University). Our primary website it hosted elsewhere but part of the site (student registration system) is hosted onsite.
What I did was to create a Authoritative (A) DNS Record (reg.domain.com) and made it point to the IP of our onsite server. And that did the trick!!!
Here's a screenshot of the same from my domain CP (domain and IP masked for obvious reasons)...
alt text http://img443.imageshack.us/img443/5069/stiuaregrecord.jpg
It's essentially the same as what you're trying to do. Give it a shot and see :)
In the DNS records/manager for the parent domain of the intended subdomain:
point the subdomain name at the to-be host servers IP address, then ...
... Then ...
In the host server DNS and or server-software config: direct the subdomain to the website app. You can achieve this by one of: -
manually edit the DNS records,
park the subdomain and point it at the website document root folder, or
add the domain and subdomain (domain will never be used since its not pointed at applicable server). Point them both at the document root for your now subdomained (if there is such a word) website app