Self-hosting a domain

editor: David Buttler
Return to Index

Contributors: Sanjeev Dwivedi
The process is pretty simple once you have it figured. This is what I have come to understand but you better confirm the details.

Say if you bought LALA.com from someone called registrar.com

Now if you dont know how DNS works, if someone wants to contact LALA.com, they need to contact the root servers "." (each domain has a "." at their end. We normally omit that ".", so e.g. "laila".com is actually "laila.com."

Root servers will tell you that the address of the authoritative nameserver for the "com" domain is "nameserver.com". Then you go contact nameserver.com and ask it about "laila.com". (check this point as Reference point R1)

At this point two options come in:
a) You hosted your domain with someone called "goodhosting.com"
b) You decided to host your domain yourself on your home machine.

Case a) When you bought service from goodhosting.com, they told you that you go tell registrar.com that you will be hosting the domain with goodhosting.com. You go and tell registrar.com the same. The way this "telling" is done is by updating registrar.com and telling them that the official nameserver for laila.com is nameserver.goodhosting.com. (At this point I figure that registrar.com will update this information in the database of nameserver.com; see Reference point R1). Any queries to nameserver.com for "laila.com" will be directed to nameserver.goodhosting.com which can answer the query because you hosted your domain with them. (left a few details here)

Case b) Your home machine is connected to internet via DSL or Cable, so you dont have a static IP. The solution is to go with the dynamic dns providers (like dtdns.org). What they do is to allow you to create a subdomain under their domain. So like you can create a domain called "dilruba.dtdns.org". They will allow you to update the IP address associated with this domain dynamically (using scripts). Thus your home machine has a static "name" now. Ok now to the web hosting part. So you buy another service from registrar.com, called HTTP redirection and update them with the information that any requests for laila.com should be forwarded to dilruba.dtdns.org. (HTTP redirection works on the basis that if you ask for a web page from say a.com, it will redirect you to b.com.)

(So now at Reference point R1, nameserver.com tells you that the official nameserver for laila.com is "nameserver.registrar.com".) nameserver.registart.com tells you that the address for laila.com is that of webserver.registrar.com. When you send a request to webserver.registrar.com with the request "GET LAILA.COM", it redirects your client to dilruba.dtdns.org. So effectively all requests for laila.com come to your home machine.

Now this http redirection is a bit ugly because when the user's web browser will reach "dilruba.dtdns.org", instead of "laila.com" showing up in the URL field. it will show up dilruba.dtnds.org". At this point you start thinking why the hell did you pay for registering the domain laila.com at all.

Enter stealth redirection. Stealth redirection is almost same as http redirection except for the fact that webserver.registrar.com does not simply redirect all requests for laila.com to dilruba.dtdns.org but it also does one simple trick. It serves a page to the user asking for laila.com. This web page that it has served will have two frames. The first (top frame) will not contain any content, the other frame will have a link to dilruba.dtdns.org, so it will load the web page from dilruba.dtdns.org. But as is apparent, the URL in the user's browser still shows laila.com because that is where the original web page was served from.

There are other options like managing your own domain by configuring your own nameservers, but that is out of scope for most of the end-users.

So by now you must have figured that managing your own domain in the way of Case b) involves a lot of overhead, dns resolutions, redirections as well as a certain dependence on the performance of webserver.registrar.com. Also your home machine (especially if it is DSL) does not have a good outbound bandwidth, so your webpage might just suck big time when it comes to loading. It might work for moderate loads but I am not sure. I bought the domain just 2 weeks back and I am still working on it.

I know I did not put it in the best of the words, but I typed all this stuff yesterday and I dunno because I exceeded my quota or what, the mail did not go thru.

-sanjeev -----


Monitor this page for changes