Linking the purchased domain to our website
Here is the progress we have made so far:
- We purchased the domain name
- We purchased Cloudways hosting and created a web server in it
- During the server creation process, Cloudways also created a basic WordPress site for us automatically.
- We have also accessed this basic website using the temporary URL
Our next step is to link the purchased domain name with our WordPress website.
This will help people on the internet access our website with the purchased domain name instead of the temporary URL.
We call this domain-linking process as "Domain Mapping".
And we can perform the "Domain Mapping" in two easy steps:
- We need to add the IP address of our web server to the domain name we registered on Godaddy
- After that, we need to link the domain name to our WordPress site
Step 1: Adding the IP address of our web server to the registered domain name
This first step is further divided into three sub-steps.
Step A: First, we need to access the IP address of our web server.
To achieve this, Go to the Cloudways Dashboard and click on the "Server" link from the header menu.
This will take us to the list of web servers we have created.
Currently, We have created only one server that is costing us $14 per month, and it is being presented as a big box.
When you click anywhere on the server box, it will take us to the page where we can access all its settings and information:
We call this screen the "Server Management" screen.
And if you notice this screen, there is a section called "Master Credentials":
And it contains important information called "Public IP".
This is the IP Address we are looking for.
Click on it to copy it because we will use this IP Address in our domain registrar's dashboard.
Step B: Go to the Domain Registrar's dashboard and access the DNS records of the purchased domain
In my case, I purchased my domain name on Godaddy.
So, I will go to the Products screen inside Godaddy's dashboard and scroll down until I see the "All Product and Services" section.
Inside this section, there is a sub-section called "Domains".
And inside "Domains", we can see the domain name we purchased recently.
In my case, the purchased domain name is criyasoft.com
.
Also, if you notice, there are three action buttons for this domain name:
- Set up
- DNS
- Manage
Click on the "DNS" button to access the DNS records of our domain.
Step C: Link the IP address to the domain name
DNS stands for Domain Name System.
And every domain name will have some DNS records:
The DNS record we are currently interested in is the "A" record.
If we add the "IP Address" to the "A" record of a domain name, the domain mapping will be complete.
To achieve this, click on the pencil icon to edit the "A" record.
Now, if you notice, there is a field called "Value" and it is currently set to "Parked".
Replace the value "Parked" with the IP Address of our web server.
Finally, click the "Save" button to save the changes to DNS records.
That's all.
That's how you map a domain name to a web server.
But the Domain mapping doesn't happen immediately.
It could take 15 minutes to 24 hours.
But in most cases, it takes less than 15 minutes.
So, let's wait for 15 minutes.
...
...
After 15 minutes, put your domain name in the browser and see what happens.
I have now put my domain name criyasoft.com
in the browser, and here is the result:
Can you see the Cloudways logo at the top of the page?
This means that our purchased domain has successfully mapped to our web server on Cloudways.
But currently, it also says that the website is unavailable.
The reason behind this is simple.
Although we have mapped our domain name to our web server on Cloudways, we didn't map the domain name to our WordPress site.
So, here comes the next step.
Step 2: Linking the domain name to the WordPress site
To achieve this, go back to the Cloudways dashboard and click on the "Applications" screen.
Next, click on our WordPress site:
This will open the advanced settings that are specific to our website.
Next, click on "Domain Management".
If you notice, currently, the Cloudways' temporary domain is acting as the primary domain of our WordPress site.
This is why we could access our website using the temporary URL we saw earlier.
But we should make our purchased domain name the primary domain of our site.
Otherwise, we can not access our website using the purchased domain name.
To do this, click on the "Add Domain" button and enter your purchased domain name:
Then, click on the "Add Domain" button again.
The domain name is now linked to our website but is not the primary domain yet.
To make it primary, click on the "three dots" icon associated with the purchased domain and then choose the "Make Primary" option from the dropdown:
Cloudways will ask for the double confirmation and say okay to the confirmation.
After this, Cloudways will take some time to set the domain as primary.
And there we go.
Our purchased domain is now the primary domain of our website.
The domain name linking to our website is now 100% complete.
Give it 5 minutes, and then try again entering the domain name in the browser.
...
...
I will enter criyasoft.com
in the browser and see what happens:
And Bang!
There is an error and it says, "Your Connect is not private".
But don't panic.
We can quickly fix this error by adding a Free SSL certificate to our website, and we will do that in the next lesson.