Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have bought a new domain name from GoDaddy. Let's say it is abcd.com.

On GoDaddy's DNS Managing page, I changed A(Host) part to

@ = 74.125.232.215

which is www.google.co.uk's IP address.

Now if I type www.abcd.com, it directly goes to www.google.co.uk.

But if I type http://test.abcd.com, it cannot be loaded.

Do I need to define every subdomain through GoDaddy? Is this how it works?

P.S. Amazon EC2 directly generates a subdomain for users to reach their virtual PCs. It cannot be domain registrar dependant.

P.S.2. Same question for using "www2" at the start of url.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

Google does NOT like when you set your A-records to them (they set it so if domain != 'google' then redirect to google.[com] and therefore preventing people from using Google under their own domain)

The @ means "naked domain" so it would be "abcd.com" and you DO need to specify a www record (as well as test) to whatever IPs you want them to go to. If it is supported, you can do * instead of @ which would make wildcard.abcd.com go to that IP.

Amazon generates a subdomain for its users, because their servers are (for the most part) shared. The only way to differentiate between two users is to identify it by name, thus the server does what is called a VirtualHost where it can serve [the correct user's content] by "listening" for that identifier.

Picture it like this: you're at work, with 50 other people, in a room together. Someone comes in and says, "I need to speak with John Hancock!" and so [the room is the "server"] will send John Hancock to speak with the person [where John is the "correct website"].

If you have a domain and try to access test.abcd.com but it's not defined in the DNS, you will get a "unknown host" error, since hte DNS server has no data for it (Like if there was no John Hancock in the room) and would return an error (everyone looks around for John and then ignores the request).

But you'd rather point the www A-record to the IP (or make a CNAME record to the hostname) of [your Amazon server?]. Not to Google. The difference between an A and CNAME record, is that A-records can ONLY go to IP addresses (AAAA records are for IPv6) and CNAME records ONLY (for the most part) go to hostnames. A-records are faster to load on the end-user, because their computer has to only look up the IP of the host you set it to, whereas a CNAME record is safer to use (if the IP changes, you only have to update the other host, not all the A-records) but is marginally slower, because the end-user has to look up both the first host, and then resolve the second host.

And finally, the www2 subdomain. You need to create this separately as well (unless you wildcard your naked domain). But on your [web host] you should specifically make it listen for these different subdomains. What's the purpose of using www2 on top of www if the content is the same and it's on the same server?

And for extreme clarity: you should pick whether to serve content on the naked domain (abcd.com) or the www subdomain (www.abcd.com) but not both. (For reasons to be explained later if you ask due to length).

share|improve this answer
    
Your answer is more than what I needed. I tried it now with *, and works. All big companies like google, microsoft, apple, facebook uses "www" subdomain. I wonder if there is any reason for that. Anyway, I will look for how @ gmail.com, @ hotmail.com like email domain names are taken. If I can't learn, I will be back in stack exchange. –  tcak Aug 31 '12 at 17:06
1  
@Johnny - I can answer that right now. You have to set up what are called MX-records which tell @abcd.com email addresses which mail server(s) to use and with what priority. You can own a domain, and have email accounts, even without a website on it. (Or the other way around). –  ionFish Aug 31 '12 at 17:32
add comment

Just to add to ionFish's very comprehensive answer,

Do subdomains need to be defined through domain registrar?

They don't need to be defined through the domain registrar, but wherever the master DNS records are located. At the moment they are at GoDaddy, but if you changed the NAMESERVERS on your domain at GoDaddy to point to an alternative DNS server, you would change the DNS at that alternative DNS server, not GoDaddy, which is still the domain registrar.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.