As a web developer, you must know the ins and outs of building a website from scratch. Aside from knowing which CMS or web hosting to use, you also need to know how a web domain works and how it connects to your hosted website.
This may seem like a basic topic to discuss in the scheme of things. However, if you read this article through the end, you will learn the important role that Domain Name Service (DNS) plays in making your website more accessible online.
What is DNS?
Before talking about Domain Name Server, let’s talk about life without DNS.
Imagine you want to go to Google on your browser. Instead of typing out google.com on the URL bar, you need to enter http://216.58.192.164/ instead.
If you do that, you will head on to Google exactly like when you entered Google on your web browser.
Now, imagine if all websites are like that. You must memorize the numbers of all the websites you want to visit, which represent their respective IP addresses. It is a series of four numbers between 1 to 255, each of which is separated by a dot. You keep a handy list of these addresses so you don’t forget them.
Thanks to a DNS, things never reached that point. All you need to do ever since is type in the domain name attached to the IP address of the site to visit it.
There are unique ways or “records” you can use to connect a domain name to an IP address:
- A record – points domain name address to an IP address.
- CNAME record – points domain name to another domain name, This is commonly used to point the non-HTTPS version to the secure version.
- TXT record – used to verify the owner of the domain.
You can set these records from your domain registrar.
Parts of a DNS
As mentioned, DNS facilitates the interaction between the hosted site and the domain name. However, how do website visitors come into play in relation to DMS?
There are the three major components you need to know about DNS and server requests from web clients:
Domain namespace
It assumes the inverted tree structure with the root domain at the top. From here, you can see the different levels and subdomains branching off from the root domain. For example, just below the root domain is the top-level domain or TLD, referring to the domain extension, i.e. .com, .org, .net. The second-level domain, which is the domain name access to your site’s IP address, comes next, From here, you can create different subdomains under your chosen domain name, i.e. subdomain1.domain.com, subdomain2.domain.com, etc.
Resolvers
These draw out information from the nameserver according to the user request.
There are two types of resolvers in this case: the stub resolver and recursive resolver. The former is responsible for managing DNS queries coming from local computer applications.
Let’s say a user clicks on your page from the search results. The request will go through the stub resolver first.
The next step is for the stub resolver to pass along the request to the recursive resolvers, which serves as the middleman between the web client and nameservers. If the requested data by the query is cache, the resolvers will deliver the stored data to the web client of the user. Otherwise, it passes the request to the nameservers.
Nameservers
These contain the information about the domain namespace. You can set the details of your namespace.
Resolvers communicate the request to the TLD or authoritative nameservers. From here, resolvers will have to scour different physical servers since the data of your domain namespace is distributed across multiple servers.
The issue here gets worse if there are lots of requests coming in and out from different web clients. The stress put into not only the resolvers but also the servers will almost always result to the slow processing of requests.
Nonetheless, once the data is acquired from the nameserver, it passes it along to the resolvers and back to the web client.
DNS services
As mentioned, the risk of slow loading speed is prevalent in the exchange of information taking place in the DNS. More importantly, the process outlined above is not privacy-respecting. This means online threats can intercept the data passing through the resolvers, nameservers, and your device.
To keep your online activity fast and safe, there are different DNS services available for your choosing. Tools like Cloudflare, Rackspace, and Namecheap are some of the free and more popular ones in this space.
You can set each one up using the Control Panel from your web hosting provider. Each service may have instructions for installing it with the site, so be wary of this information.
For web client users, it’s also useful for them to use a DNS service that allows them to access the web in a secure and faster manner. Smart DNS servers also allow people to unblock geo-restricted content as part of the package.
Liked this article? Please share it by clicking on the button of your favorite social media site!
Related posts:
How to Make Sure Your Website is Secure for Users
Choosing the Right Platform to Manage Multiple Sites at Once
The post DNS 101: An Idiot’s Guide for Web Developers appeared first on SpyreStudios.