This post is all about your favourite thing in the internet world DNS or Domain name system to give it the full title.
What is Domain Name System (DNS)
So lets start with what is DNS. Computers do not use normal addresses they use numbers for example 220.127.116.11 this is an IP Address. It's not very useful to give out.
Find my site at 18.104.22.168!!
What we have instead is the DNS system. This allows us to use an address serversncode.com and point it to an IP Address. and then when you go to serversncode.com you can get to the right place on the internet.
How does it work
So how it works is really simple. There are Nameservers around the world that hold the directory of every internet address. These name servers keep themselves in Sync back to several core nameservers.
When you buy a domain name. This domain name will have it's own nameserver. This name server will then contact the others to say "This is a new Address" and then that address will start it's sync journey.
That's why it can take up to 24 / 48 hours for an address to fully roll out. As all these name servers have to get it.
DNS has different types of records for different purposes. Some are for verification for different services like email, some are for users to be able to find you. This is not an exhaustive list, I'm just going to give an overview of some that are commonly used.
The first and most important is the A record. An A Record is basically a pointer to the IP Address for example.
serversncode.com -> 22.214.171.124
You can also use an A record for a subdomain for example if I wanted blog.serversncode.com I could create an A Record pointing to the new domain.
An A Record will always point to the IP Address of the server.
A CNAME record is alot like a subdomain and similar to A record however it can point to both an IP and another DNS address.
cname.serversncode.com -> serversncode.com
Txt records are used for alot of different things but mostly they are used for verification to other servers.
If your setting up an email address you will likely be asked to set the txt record on your DNS so they can verify it's you.
These are for your email. Mail servers will look for the MX records to decide where to route your email and get it to you.
This is your Email spam verification. This is needed to help verify your not a spam bot from the domain.
A DNS record has a Time To Live - TTL, you can set it as you want, my advice leave it to the default. This is how long before that record is rechecked by the name servers.