DNS, Domains and sub-domains explained
When you think of Hosting, one of the first thing that comes to mind is your domain name. A domain name is, basically, your brand on the Internet, like Shanghai-Hosting.com. As it is the first thing users see of your web image, it’s often a critical point to understand. Let’s see how it works.
On the Internet, we’re all just computers. Servers, laptops, smart-phones and an increasing number of smart-things are connected together and identified by numeric addresses.
The main protocol used nowadays is IPv4, which consists in four numbers from 0 to 255 separated by dots, the famous “IP address“. This blog runs on a server accessible at 220.127.116.11.
But of course, people would never remember random numbers to go to your website. Additionally, one single server can host many different websites, and one website same could be accessible via many servers (think www.google.com for example).
So how do we make the bridge between number-crunching machines and wordy humans?
Enters the DNS, or Domain Name System. The DNS is a vital protocol that, like a phone book (for those old enough to remember what’s a phone book 😉 ), matches domain names and IP addresses.
Specialized servers, distributed around the world, handle databases linking your domain to one or more IP addresses. Generally the company that sold you your domain provides a web service to allow you to configure it.
When you change a DNS record, the new setting has to be updated on these server around the world, so it usually takes up to 24 hours to be effective everywhere.
So if you already have a server but want to change, no problem! You only need to update your DNS records with the new server’s IP address.
Your domain name is what is directly before the final extension (including the extension itself)
For us, our domain is shanghai-hosting.com
Notice that the domain contains nothing before shanghai. Whatever comes before is a sub-domain.
The extension is there to inform the visitor about the type of site she’s about to visit:
- .com : commercial website
- .org : not-for-profit or NGO website
- .cn : China website
But as you can see, you are currently on a sub-domain: blog.shanghai-hosting.com that links to this blog.
Another sub-domain would be the familiar www.shanghai-hosting.com that links to our main site.
Usually there are no practical limits to the number of sub-domains you can have for one given domain, and each sub-domain can be completely independent from the others.
It is perfectly acceptable to have china.mycompany.com linking to a server in China with a Chinese IP address, and brazil.mycompany.com linking to a server in Brazil with a Brazilian IP address. All for the same mycompany.com domain !
And, for China, the best is that you only need to register an ICP number per domain, not per sub-domain. So if you can group different sites on one domain, you only need to register once.