What is DNS & How it works?

dns

                You’ve probably noticed how DNS is mentioned all over the Internet. Every website uses it and every website owner should know more about DNS because without it your website will not be visible to the Internet users. Understanding how DNS works is crucial so that is why in this article we will cover the DNS basics and we’ll explain what exactly happens when you type a domain, for example XYZ.COM in your web browser.

What is DNS?

First thing’s first – you must know what DNS actually stands for. DNS is an acronym of Domain Name System and it’s widely used in different mediums. As the name suggests, DNS is a naming system that gives a name to any computer or service connected to a network. DNS is utterly important and everyone should use it. Without it, we’d have to visit websites through their IP addresses, rather than their domain. So, for example, if you wanted to visit our website through it’s IP address, you’d have to go to X.X.X.X. But with DNS, you can go to XYZ.COM. It’s easier to remember and it’s more user-friendly. That’s why people consider DNS “the phone book of the Internet”. Nobody wants to remember an IP, but every one can and does remember a domain name.

How does DNS work?

There’s lots of stuff going on “behind the scenes” when you visit a website. There’s a communicating relationship between a few servers and your computer.

These are the usual steps they take:

  1. The user enters the website’s domain in the address bar

The DNS translation process stars when a user types in a domain name/address in the URL bar of his web browser. With that, the user essentially requests the IP address of the domain and waits for a response.

  1. The browser and OS check their local cache

After a user requests information on a domain, the user’s OS and browser check their local cache for any information on that domain. If the domain is already in the cache, the browser returns a positive response, if not, the Resolver needs to be contacted.

  1. The Resolver checks the local cache

In most cases, the resolver is actually your ISP. First, the resolver checks to see if there’s any local data available. If not, he contacts the domain’s root server. What is a root server you ask?
Well, a root server is a name server that covers the root zone of the Internet’s Domain Name System (DNS). It answers requests for records in the root DNS zone among other requests. For example if a request is received and asks what are the authoritative name servers for XYZ.COM, it will return the authoritative name servers for the respective top-level domain (TLD). The root name servers are the first step in resolving human readable host names into IP addresses thus making them a critical part of the Internet infrastructure. There are 13 root nameservers specified in the world. But don’t let this information scare you. It does not mean that there are only thirteen existing physical servers. They each have redundant equipment in place that provides reliable service even if failure of hardware or software occurs. Additionally, the root name servers operate in multiple geographical locations that use a routing technique called ANYCAST addressing. Wikipedia’s definition for ANYCAST addressing is: a network addressing and routing methodology in which datagrams from a single sender are routed to the topologically nearest node in a group of potential receivers, though it may be sent to several nodes, all identified by the same destination address.

  1. The root server checks the local cache

After a request is received for a domain, the domain’s root server checks the local cache for any information about the respective domain. If there is such, it responds with the IP, if not it points the resolver to the TLD server. The mode of operation of the root nameserver involves looking at the first part of the request, reading from right to left. So let’s use our website as an example again. In this case the root nameserver checks the request for rosehosting.com, sees that the TLD is com and forwards the query to the respective TLD nameservers.

  1. The root server forwards the resolver to the TLD server

The TLD nameservers review the next part of the request (XYZ) and directs the inquiry to the nameservers responsible for XYZ.COM which are called authoritative DNS servers. These authoritative DNS servers contain all the information about xyz.com stored in DNS records. There are many types of records with each carrying a different kind of information. For example, if we want to know the IP address for google.com we need to know the A record for the domain.

Below is a list of some of the available DNS records which in general are mostly used:

  • A record: the address record which links a domain to the physical IP address of the server that will host the domain
  • CNAME record: the Canonical Name record points an alias name to another domain name. For example, http://www.xyz.com might link http://www.xyz.com to xyz.com where www is the actual CNAME.
  • MX record: mail exchange (MX) records serve to direct the domain’s email to the server that hosts the email user accounts. The MX record specifies the mail server responsible for accepting email messages on behalf of the recipient domain.
  • NS record: Name server records determine which servers are authoritative for a particular domain which means that the DNS servers set as authoritative for the domain will be responsible for communicating DNS information.
  • TXT record: this record provides text information with a host or other name about a server, network, data center etc… to sources outside your domain.
  • TTL record: TTL (Time To Live) is a value in a DNS record that specifies the maximum amount of time other DNS servers and applications should cache the record.

With this short info on the DNS records out of our way, we can now continue with the article. Where were we? Ahh, yes.

The resolver now retrieves the A record for XYZ.COM from the authoritative DNS servers. The record is now stored in it’s local cache so if anyone else requests to visit the XYZ website, the resolver or (as others call it) recursive server will already have the answer so it won’t have to go through the above explained lookup process again. Of course depending on the TTL record set for the domain, the recursive server will have to ask for a new copy of the record to make sure that the information is up to date.

  1. Receiving the answer

The resolver now has the A record for XYZ.COM and returns the info back to your computer. Your machine stores the record in the respective cache, reads the IP address from the record and then passes the information to your web browser. The browser opens a connection with the web server of XYZ.COM, receives and then displays our website on your screen.

Even though this process seems like it’s time consuming, it only takes milliseconds to complete.

Don’t forget to like & share this post on social networks!!! I will keep on updating this blog. Please do follow!!!

 

Understanding AWS(Amazon Web services) “The Cloud”

To understand AWS, we need to understand the basics of Cloud Computing first. Let us take you through Cloud definition and need of Cloud computing and then we will figure out how AWS fits into role of Cloud Computing.

The need of managed services by third party

A Case Study: Let’s say you are a startup company to host a website. You need to host your website and start selling products. Following are the things you would need to invest upon-

  1. Servers: Front end Web Server, App Servers, Database Server to serve required stuff.
  2. To Store the customer data you need to set up a database powered by various tools to connect to that database.
  3. To handle all the software and services issues, you need to set up an IT office and for that you may have to invest again on Laptops, desktops for employees, network, firewalls, LANs, WANs and even to rent a property.
  4. To handle all the hardware related issues, you need to hire employees who have such expertise. Again Office set up for those employees.

After investing so much if some years down the line there is recession in the market, then due to cost cutting all the resources including employees, will be required to be scaled down. This means wastage of our investment in case of uneven circumstances.

Also if we have some new sale or scheme to be launched which require addition of some servers on demand that needs many days if not months to add new resources which are exact replica of existing ones.

ANY SOLUTION WITH NO INITIAL INVESTMENTS?

Why not outsource IT infrastructure part. Let somebody else manage hosting your website, handling traffic on your websites, managing your database, hardware, patching, OS Upgrades and even in some case software installations and up-gradations. Wouldn’t that be wonderful!!!

Indeed that would be. This is nothing but Cloud Computing. When someone shares its resources with others and manages it for a specified amount (i.e. a required monthly rent), and you use those resources as and when required (without bothering about anything) , over the internet or over some private network.

That someone else managing your resources or giving his resources to you on rent is known as CLOUD SERVICE PROVIDER (CSP). 

Read the Wikipedia definition- (https://en.wikipedia.org/wiki/Cloud_computing)

Other Advantages of Cloud Computing

  1. Scale Up or down whenever required
  2. Pay for the amount you are using (when you are not using any resource, no bill is charged)
  3. No upfront investment
  4. CSPs make use of Virtualization, Multi tenancy etc. to save power hence supporting go green environmental cause
  5. Also the resources are fully utilized by sharing technique

Types of Cloud Service Models

Not all service providers can give you everything you want. So it’s important to know about the various categories of services which are provided by different Service providers-

There are three types of Service providers-

  1. IAAS
  2. PAAS
  3. SAAS

IAAS (Infrastructure as a Service): The provider which provide you all the infra you require to start your business are IAAS providers. This means CSP will be giving you infrastructure like servers, networks, storage etc. and managing it. Though installation of middle-ware and software etc. will be your own headache. But advantage is you can customize that part according to your own need. AWS will fall under this category.

PAAS (Platform as a Service): This category goes to those providers who give you middle-ware like IDEs ready for your code to be deployed upon. You just need to build and manage your application on the complete platform which consists of OS, IDE, firewalls, development tools , runtime environment etc.

SAAS (Software as a service): In this model, complete abstraction is done to the user as software is hosted somewhere else, and user just uses that as a service. To be more precise the best example is – GOOGLE DOCS (Microsoft office is installed somewhere else, but we use it as a service and we don’t need to install it, rather we can create documents presentations etc. without office on our systems).

Image below Will give you more clarity on what is managed by a CSP:-

cloudmodels_piyush

Types of Cloud Deployment Models

Now that if we talk of IAAS and PAAS provider, how and where they manage our data is another question which divides the CSPs further into categories-

Public Cloud – When Cloud infra is shared amongst more than one organization or individuals and they use that infra over network which is for public use that is public Cloud.  For e.g. I am a CSP and have a physical server. On that I can create 4 different VMs and give those 4 VMs to 4 different organizations over a network.

Private Cloud – When the underlying hardware is dedicated to one organization and is managed my either CSP or internally by an organization leveraging the advantages of Cloud Computing is Private Cloud. Its obviously expensive than Private cloud.

Community Cloud—when we have a private cloud not for one organization, but for more than one having common concerns or legal requirements, it is called cloud for community. That Community shares the cost with all the advantages of private cloud

Hybrid Cloud – Combination of at least one private and public cloud is hybrid cloud

Now what is AWS?

AWS –Amazon Web Services is CSP (Amazon.com) which provides you mainly IAAS and uses PUBLIC cloud as major deployment Model.

Do we have other CSPs apart from AWS in market?

Indeed we have – hundreds of them – visit the wiki link to know about the names J

https://en.wikipedia.org/wiki/Category:Cloud_computing_providers

Why AWS then?

AWS have many advantages when compared to other. Its way ahead than many other provides. Some of the advantages are as below.

  1. Number of Edge locations, which will give low latency.
  2. Easy and user  friendly infra deploy tools
  3. Fastest way to deploy infrastructure by using images and automated tools like cloud-formation.
  4. Hourly billing
  5. Easy to destroy any unused infrastructure

And many more.

History and reach about AWS

AWS have a very strange history and Amazon never thought it will shape to this gigantic IT company. Many people know that AWS is a collection of web services from Amazon which sells from books to what ever items you want through online. In 2003 Chris Pinkham and Benjamin Black thought of stream lining Amazon infrastructure deployment and  by end of 2005 they realized about selling these stream lined infrastructure as a service to clients. In 2006, Amazon launched AWS services with some basic services and now it’s used in more than 190 countries across globe and provides 80 + services in following categories-

AWS Compute Services

AWS Network Services

AWS Storage Services

AWS Database Services

AWS Management and Developer Tools

AWS Analytical Services

AWS IOTs

AWS Application Services etc.

 

Conclusion–   So what we can summarize so far is that there are various challenges in managing or setting up of our own datacenters and Cloud computing seems to be the only solution for that. Cloud computing means delivering of IT resources via the Internet or we can say using a resource over a network on RENT instead of buying it. AWS is the collection of some of the cloud services provided by Amazon. In our next post we will see about the services provided by Amazon AWS services.