What is DNS? Everything you Need to Know!Vijay Kumar
DNS stands for Domain Name System and It is what powers the internet. You knowingly or unknowingly interacted with DNS before while creating your own website or when someone just mentioned.
DNS holds all the IP addresses and works as a translator of names into numbers (IP Addresses). IP address corresponds to a device on the network. It can be a local network or the internet.
So when you type www.grootsolutions.com it will translate to the IP address of the device that holds the website.
Domain Name Rules
There are mainly 3 types of TLD’s such as country specific TLD’s. EX. .us, .uk etc. Another type is very generic such as .com, .net, .org, .edu etc. Another type is infrastructure TLD’s
There are some restrictions to top level domains.
And all domains should follow the LDH rule, means that Letters, Digits and Hyphens.
- A – Z lower or upper case
- Numbers 0 – 9
- Can use a hyphen
- A domain name cannot start or end with a hyphen
DNS TTL and Propagation
TTL stands for Time To Live. This means that whenever you set a record you will also set a TTL for each record. This will tell DNS that how often that record will update.
Because DNS is a very distributed system. Those records will tell which system to look into for the content and where it is located.
Usually, the DNS will cache all the records for the time set in TTL. This can be useful if you are working in a production or development environment.
Let’s say you are working on a website and if you want to see the changes immediately you must the TTL very low and if you are down with all the changes and in the production level, you can set TTL high so that the DNS server no need to request for records in a short period of time.
Name server provides answers to all the queries that a DNS get. Name servers contain all the information related to you DNS records such as root domain IP address, sub domains, MX recoords, TXT records etc.
There are two types of name servers, Master and Slave. Those two share the server load and improves the availability of your DNS
There are several different options when hosting a DNS. Some registrars such as GoDaddy or Namecheap are offering free DNS hosting. It is usually a good idea to move to a DNS only provider because most of the time registrar DNS is more basic.
You can also host your own DNS on your server but it is difficult to manage and you need at least two servers dedicated to it.
Root servers are the servers that store the name servers. Root servers will have root zones that will translate human-readable words into IP addresses. There are a total of 13 root servers around the globe.
The root servers are handled by company call ICANN (Internet Corporation for Assigned Names and Numbers). Without the root servers there would be no internet.
When a computer contacts name server and request the information, a set of request are returned.
One of the most important records is A record. ‘A’ record points to an IP address. There is no limit to the number of A records you can have on a domain such as. www.domain.com, mail.domain.com, server.domain.com, etc.
There is one important type of A record available. ie. Wildcard record.
This means that you can have a * sign in any part of your domain to direct traffic to one particular IP address. For example, if I want to direct my traffic of any subdomain such as mail.domain.com, sub.domain.com, etc to a one particular IP address such as 18.104.22.168 by simply adding an A record with *.domain.com.
The MX records are responsible for pointing the server that accepts the email requests.
MX records are specified to only one server but you can add more by setting the priority to the mail servers. The priorities can be set with numbers such as 1, 5, 10, 20, etc.
Always the first server with priority 1 will receive the mail requests. In case it fails to process it or unreachable then the next server in the list will be used to process the email request.
Here are the MX records that Gsuit users will get from Google in order to use their Gmail services on the custom domain name.
CNAME record can also be called Canonical Name Record. This type of record used for aliases such as sub domains.
Let’s say you have 20 coffee shops in different areas of your city. In that case you can make domain aliases such as area1.domain.com, area2.domain.com, area2.domain.com etc.
This is more beneficial compared to adding all of them to A records. Why?
Because whenever you change your web server IP address you don’t need to change all the IP addresses in the A records. Instead, you can just change one main domain IP address and all the subdomains start to using the website served from that server using a new IP address.
Fully Qualified Domain Names (FQDN)
Most of the time when you are working with domain names you need to refer to the fully qualified domain name (FQND).
For example when you take a www.domain.com and you cannot only mention www to refer to your domain. So you must specify the full domain www.domain.com, this is fully qualified domain name.
Whenever you are referring to FQDN it always ends with dot at the end of the domain. It doesn’t matter if you put a dot at the end because most of the times your DNS provider will add at the end of the DNS record.
TXT record stands for text record. This record contains the text of any type. Most of the times service providers use this text records to verify the domain ownership.
There are some special types of text records such as SPF records (Sender Policy Framework). These SPF records are responsible for handling mail servers on behalf. If you want to send a mail from another mail service provider you must add that mail service sending server domain and IP address to the SPF records. By this whenever a mail is received to a mail client it will look for these SPF records for authentication.
There are few types of SPF text records
- + Pass
- – Fail
- ~ SoftFail
- ? Neutral
Example: v=sapf1 include:_spf.google.com ~all
This means that Google can send mails on your behalf.
So why you need to worry all these things?
Simple answer to this question is to avoid spam. If there is no such verification mechanism at domain level, anyone can send email on behalf of your domain which causes many problems.
So it is a must to add SPF records while sending mails to your clients.
There is also another type of TXT record that you must add to your domain, that is DKIM.
DKIM stands fro Domain Key Identified Mail.
This can be done by adding a DKIM signature to the message header and telling the receiver that the mail sent from the server is the same and not modified. This is very useful for mail security purposes.
PTR records stands for Pointer Records. These are useful for Reverse DNS. This PTR records will helps to verify the domain name that is actually associated with the IP address.
These PTR records will contain the web server IP address that the website is actually loading from. This helps to avoid any server hacking or IP changes without your permission.
Format: in-addr.arpa with IP address in reverse.
Ex: Example domain.com –> 22.214.171.124 then the PTR record would be like 126.96.36.199.in-addr.arpa. This is very useful to confirm reverse DNS.
The type of record is SOA record. SOA stands for Start of Authority.
When you request a DNS zone file from the Name Server it is the first entry in the DNS zone file. This record indicates that this DNS name server is best source for data with this domain.
This tells that how often this domain is updated, who manages it etc. Most of the time this SOA records are handled by the DNS provider or your domain registrar.
Format of the SOA record is as follows.
The first entry of this record will start with an email address of the host, but with dot instead of @ sign. Ex. host.domain.com instead of email@example.com.
There are also serial numbers, retry time, refresh time in seconds, and expire time with in the domain. The SOA record will also contain a minimum TTL which is the default TTL most of the time
Now you have complete knowledge on DNS. You can now set up your DNS records properly without having any issues. If you think you might miss something while setting up records into your domain you can always check this guide.