When you established a new website, you need web hosting to publish your website on the internet and register a domain name. But do you know about the domain name and sub-domains? Although, these are the most common concepts that are used in web development. But many people’s especially beginners, become confused between the domain name and website hosting. They don’t know the main difference between them.
So I am going to talk about the domain name and sub-domain in detail. Let’s start:
What is a Domain name?
A domain name is an identification/address of your website on the internet that users can access by using the domain name from any device worldwide. Google.com, Facebook.com, Wikipedia.org, and Yahoo.com are some examples of domain names.
Internet is a vast network of connected devices all over the world. Every computer is assigned an IP address for its identification over the web. An IP address is an array of numbers, such as 188.8.131.52 is an example of a typical IP address.
This string of numbers is not easy for humans to remember. So domain names are invented to solve the numbers issue. Now users are able to write a domain name instead of typing a long array of string in the URL to access a website.
Working of a Domain Name:
Working of a domain name is a complicated task. They allow your system to find the server where your website files or data are saved. So to thoroughly understand the entire process, you need to know about the IP address and DNS.
1) IP Address:
An IP address is provided by an Internet Service Provider company, which is a combination of unique numbers. This series of numbers is divided into four parts, and a full stop separates each division. Devices use this unique number to communicate with each other over the internet. No two devices on the internet have the same IP address.
DNS stands for Domain Name System. It is a decentralized naming system for devices like computers, tablets, and other resources. This comprehensive system is managed by the Internet Corporation for Assigned Names and Numbers (ICANN).
DNS is a vast network of servers located all over the world. All of these servers contain a distributed database of IP addresses. It acts like a phone book, shows a domain name against each IP address.
As I mentioned above, domain names are invented to solve the numbers issue. When a user writes a domain name in the web browser, your device looks it in the cache to check that either this domain name is requested before or not? If it didn’t find it, then it contacts the local DNS server.
Again, if there are no records of that domain name in the ISP cache, the device needs to find the nameservers associated with that domain. So when you find the server, DNS covert this name into IP addresses, which is the website hosting server’s address. And the server directs the user to its requested website.
What is a Sub-Domain?
Many people are unaware of this concept, even they owned their own website, but they don’t know about sub-domains. Basically, A sub-domain is a part of a domain name that comes before the domain name and domain extension. It acts as an extension of your website domain name to combine and navigate all website sections.
Let’s understand it through an example shop.example.com. In this URL, the shop is the sub-domain, example is a domain name, and.COM is TLD (Top Level Domain).
When we talk about sub-domain use, it is commonly used to logically split a website into sections. It can be used to launch a customer support website, a blog of different themes, and forum websites. Moreover, you can create a mobile version of a website; create an online eCommerce store, or build a different language version of a website.
Creating a sub-domain is not a complicated job. But before generating a sub-domain, you need to have a domain name. If you don’t have a domain name, register a domain name and then buy the rights for using the sub-domain within it.
So after getting the rights, now you are ready to create a sub-domain for your website. The process is distributed into the following four steps.
1) Login to cPanel:
The process will start from log-in to the cPanel dashboard of the website for which you want to create the sub-domain. To perform this task, login to your account and click the web hosting button to reach your cPanel homepage.
2) Add Sub-Domain:
After Login, scroll down to the domain headings in the menu. When you get the domain heading, click the sub-domains icon. A new window will appear, type the sub-domain name in the first field, and main domain name in the second. While the last field, which is DocumentRoot, will be autofill.
3) Insert DNS Records:
It is the essential step of the whole process. If you do not add the accurate DNS records, your sub-domain will not resolve correctly. So choose the web hosting from the menu, and scroll down to the DNS management section.
Now insert the required data in the fields:
- Select A record type in the menu by using the drop-down menu.
- Then type the sub-domain name in the host field
- Type the IP address in the last section
- In the end, click the add record button to save data.
4) Wait to Resolve:
You have created the sub-domain, but it will take more than 24 hours to work properly. If it takes more time, don’t worry about that, because it can be delay due to massive traffic.
So I have discussed the domain name and sub-domain in detail. A domain name is your website’s address, whereas a sub-domain is used to organize your website. Both concepts are entirely different from each other. I hope after reading this piece of writing, you are now able to make a difference between them.