Saturday, January 29, 2011

Custom Domain name problems (www subdomain)

Hi all,


This post describes the problem i faced in setting up a new domain name and solutions to those.
I purchased gunjanbansal.in from http://mitsu.in/  for just Rs 79 ($1.73) for the first year, and Rs 550 from second year onwards (Offer on .in, .co.in and some other root domains only). This is much cheaper than what most of the other registrars offer. Believe me they do offer at this cheap price. Currently their promotional renewal scheme is on in which we can renew up-to 9 years max at about Rs 349-399. Guess what owing a domain name is much cheaper than i though, specially looking at all those sellers listing the price at $10 onwards. I think its much cheaper to buy a domain name from mitsu.

I faced a lot of problems initially as I was unaware of the setups required. Also my email (gunjan@gunjanbansal.in) is not yet working. I think i better take problems and solutions one by one.

I have used my domain for google sites, and blogger.

These are the current parameters :- cv.gunjanbansal.in and www.cv.gunjanbansal.in redirect to my resume at google sites.

blog.gunjanbansal.in and gunjanbansal.in redirect to this blog.

code.gunjanbansal.in redirect to my programming blog which is yet to be worked upon.


The domain names www.gunjanbansal.in and www.blog.gunjanbansal.in unfortunalty dont redirect to any of these :(. Hey wait are you saying that www and without www domain names are different ??

Yes I am. Actually www is considered as the sub domain. By this i mean www.gunjanbansal.in and gunjanbansal.in are two different entities for the DNS servers.  I wish they were same. Most of the time we don't care to add www, but see that its auto added, so hows that ?? That is actually done using 301 or 302 redirection. The naked domain (just the top level domain and second level domain (may be third in case of .co.in etc)) i.e. "example.com" is redirected to "www.example.com" or vice-versa. www.example.com is treated as sub domain of example.com.

This redirection can be done in many ways, but the 301 redirection is best way to do so. 301 means permanently moved to other location. This is better done in .htaccess file on Apache.
See http://en.wikipedia.org/wiki/URL_redirection for more details, or better search it on the web.



Now for the URL redirection one needs a web host (most domain name registrars don't give it for free), on which one can add the redirection scripts. Unfortunately the free ones didn't impress me, and i am in no mood to buy web-space at the moment. May be I'll do in future who knows. If you have web-space, making a name server entry for hosting provider and adding all the redirection of sub-domains there (on web host) is better solution. (I'll tell in few mins what entries to be made, although they are available on net).

  • Decide what you want before u start setting up your new domain, the DNS servers take a lot of time to update (upto 48 hours) and you may not be able to check if your settings are correct in a blink of eye, this is not a programming assign my friend. You can off course try different proxy sites like hidemyass.com or anonymouse.org . There DNS servers update a bit faster and you may be able to see results pretty soon. Also try pingywebedition.somee.com which might help in faster propagation of dns changes. 
  •  There are various kinds of dns records. The records that will be of interest for first timers are :-  CNAME , A records , MX records, TXT records, Name servers. I'll first tell setup required at domain name provider.
  1. TXT records give general info about the domain/subdomain and are generally used to verify owner ship of the domain. You wont require these until unless you are enabling email system, or making use of google webmaster tools etc. 
  2. MX records :- These are used to specify mail servers. Hence would be use only when setting up email systems.
  3. CNAME record:- This is the record that is most useful. Be careful while setting this up. As wikipedia explains, these records are used for finding IP address of a domain or subdomain from a different domain/subdomain. Meaning

    If i have a CNAME record as follows :- gunjanbansal.in IN 3600 example.com, it means for the IP address of gunjanbansal.in look at example.com . It doesn't mean that this is URL redirection, neither example.com need to be a name server (The A/AAAA record for example.com will be used then). Your visitor will see gunjanbansal.in as the URL and so would example.com. A CNAME record to other CNAME record must be avoided and be used if utmost necessary (This is to avoid loops in CNAME records).  If using Google sites or Blogger, the cname record for your subdomain will be ghs.google.com . For the naked domain, its better to have a A record (There can be multiple such records so don't worry, they are explained below).  This is because a CNAME and MX record with the same name are discouraged and are not allowed by most of the domain name providers (I am not sure if they are not allowed at all). This means you wont be able to host email if u add cname record for the naked domain (off-course u can host email at a subdomain).

    Here the www.example.com CNAME entry with value example.com and example.com cname vlaue as ghs.google.com won't work as suggested here. This is because ghs.google.com would see it as a request for www.example.com rather than example.com and wont have any entry for that, returning 404 error. (Supposing only example.com is setup in blogger or google sites).

    I was stuck with all these until I realized whats going on behind the scenes. I had to spend few hours trying to figure this out.
  4. A record :- If using google sites or blogger, and not getting a webspace, you would need to redirect users visiting to your naked domain somewhere. Won't you. Just add A records for your naked domain as specified here.  Remember this is only for naked domain.
    In the coming years all of us would be running behind AAAA records :D Thanx to upcoming exhaustion of IPv4 address. These records are actual location of your domain (IP address)
  • Now in the blogger, under settings tab there is option for publishing. Choose advanced in these and provide your custom domain name. Or you can buy one if you want. I couldn't find a cheap hosting provider for .com address. There is option for redirecting the naked domain to your blog, you can tick it if you want. I faced a peculiar problem here, i think its mainly due to poor interface.  I now have 2 blogs, code.gunjanbansal.in and blog.gunjanbansal.in , What i saw was that the redirection option was either ticked or unticked in both. I couldn't leave it ticked in one and unticked in other. Actually what we see are not current settings but what blogger expect us to do, whenever you save configuration in one of your blogs, it will be there, but u might see some other configuration (presumably what blogger feels you wish to do). Don't worry about this. Just save one blog with redirection enabled and others with don't, and you ll be done. Forget about it after-wards.
  • Now in the google sites, there is something called web address. Here you can add custom webaddress were you wish your site must be hosted.
    Here also there is a problem. My website is hosted at 3 different locations (without 301/302 redirection) and search engines sees them as different :(. This problem can only be solved if u have some webspace. Until then you have to cope up with it.
  • If you own the webspace, you can add NS (name server) records for your domain (might be better if hosting very light stuff) or subdomain to your hosting providers name servers. Rest of the settings can be done at the hosting provider.
    For all this I would like to thank Satyadeep for his help in setting up the stuff when i was lost. Any suggestions are welcome. I'll update it as soon as possible.

    2 comments:

    1. Keep in apperception as able-bodied that sometimes food or added entities will arrangement with a watchmaker to aftermath a watch with their name on the face. Haynes addendum that Tiffany Co. is an archetype in rolex replica this instance. So, if you accessible the aback the movement will accept a altered name than that on the dial.There are replica rolex aswell brands that fabricated curve beneath altered names. Rolex is a able-bodied accepted affluence watch brand. But did you know, according to replica watches Haynes, they aswell marketed curve of watches beneath added cast names like Tudor, Unicorn, Marconi, Rolco, and Genex?

      ReplyDelete
    2. De nieuwe Rolex Daytona replica horloges hebben een goede met een frisse blik en het voelt alsof ze complementair zijn aan de oudere vintage modellen. Ik hou van hoe de Rolex combineren oude en nieuwe modellen en het merk heeft zo'n goede doorstroming Dat je niet zal zeggen dat modellen met elkaar concurreren onderling hoewel zij soort zijn. Deze replica Rolex Daytona is het perfecte voorbeeld van de replica horloges panerai verklaring boven de advertentie van de nieuwe zwarte keramische bezel Rolex Dat is-is het blussen van een tijdje maar is goed op weg naar de vintage, maar iets herontworpen Daytona nep horloges.

      Of je het leuk of je hebt het niet dat is vrij veel hoe ik het zie. Of is er een aanpassing Meestal in mening in de tijd, maar de eerste indruk is altijd een of het ander. Ik denk dat het een koele horloge, hoewel ik niet een origineel te evenaren 100% kon vinden, maar met de replica horloges rolex nieuwe golf van keramische randen van Rolex Heb je echt weet je spullen naar een gepassioneerd en om deze uit te sluiten.

      ReplyDelete