What is DNS?
DNS is the system in charge of finding out the IP address of each domain, and therefore, of the server where it is hosted.
In other words, you access the web domain.com from your browser, the DNS sees it and translates it to the IP address of the server where it is located (ex: 188.8.131.52), in such a way that it directs you to that server and not to another.
DNS stands for Domain Name System, or what translated becomes Domain Name System.
And how is it able to know all the IPs of all the domains that exist?
Because it uses a database where this information is stored, and each time a new domain is created it is added to that database.
The process that is carried out for the translation of the domain name is somewhat long and complex, and I think it is not important to explain it in this WordPress dictionary. If you want more information, here they explain it from PM.
How to configure the DNS
When you are going to create a website with WordPress (or any other way) you may find yourself in two situations.
It’s the first web you create. You contract your hosting plan and it includes the registration of a free domain.
In that case you don’t have to do anything at all. The domain you have chosen is registered through your hosting and is automatically assigned the DNS of the server you are going to use.
When someone accesses your domain, the DNS directs it smoothly to the server where your website is hosted and we are all happy.
You have already gone through situation 1, you have a domain with a website hosted on a server of your hosting, and you want to create another website.
In that case, you have to register the new domain through pages like NameCheap, DonDominio or other domain registrars.
Since you have registered it from an external service to your hosting, you have a domain name, but you don’t have a server to host your new website.
If someone accesses that domain, they will probably find a message from the page where it was purchased.
As you already have a hosting, you want to use it to store the new website. But to do this, you will have to ensure that when someone accesses the domain, it is directed to the server of your hosting, since right now is in the limbo of the domains.
And how do you do that?
Well, by indicating the name of the DNS servers used by your hosting.
When you buy a domain, there is a section where you have to indicate the DNS servers you are going to use.
There you have to indicate the names of the DNS servers that the server of your hosting uses, that you will be able to see them easily from the cPanel of your account.
If you want more information and know how to do it, in this article about DonDominio I explain how to configure the DNS.
Once you have entered them, they have to spread throughout the network. In other words, the news spreads that the domain you have registered has the IP address of your hosting server assigned to it.
Like when in a village a person starts going out with someone and the word begins to spread until the whole village has found out.
This process can take up to 24 hours, and once it is fully propagated, when someone accesses your domain, it will be directed to your hosting server.
Finally, from your hosting you will have to add the new domain from the option “Additional Domains” of the cPanel, and you will have your domain ready to work on it.