DNS (Domain Name System):-

In the world of networking computer don't go by names like humans do, they go by numbers, because that's how computers and other similar devices talk and identify with each other over a network, which is using by numbers such as IP addresses.Humans on the other hand are using name instead of numbers, weather is talking directly to another person or identifying a  country, place or thing. So in order to bridge the communication between the humans and computers and make the communication of a lot easier networking engineers developed DNS, and DNS stands for Domain Name System and DNS resolves names to numbers, it resolves domain name to IP address.

So when you type for example yahoo.com in your browser and if your web browser or operating system can't find the ip address in its own cache memory, it will send the query to next level to DNS resolver the resolver is basically your ISP or internet service provider, so when the DNS resolver receives the query it will check its own cache memory to find an ip address for yahoo.com, and if it can't find it will send the query to next level which is the root server. The root servers are the top, there are 13 sets of root servers which are placed around the world and they are operated by 12 different organizations and each sets have their unique ip address, so when the root server receives query from the DNS resolver for the ip address for the yahoo.com the root server don't know the ip addresses but root server know where to send the resolver to find the ip address, then it will redirect to TLD (Top Level Domain) server for the .com domain. The TLD stores the address information for the top level domains such as .com, .net, .org etc. And this TLD will give the .com and it will tell the ip address can be find in Authoritative Name Server and this authoritative server is responsible for knowing everything about the domain and the ip address and this ip will be send to your operating system and when the ip address is reached to resolver it will store the ip address in case it receives another query for yahoo.com, so it doesn't required to go though all the steps.

Questions on DNS:-

1.Is DNS TCP or UDP?
  • It uses both TCP and UDP
  • If it is less then 512 bytes it uses TCP. 
2. What is round robin DNS?
  • Distributing overload among the server is round robin DNS. round robin DNS is used for load balancing and fault tolerance.
3. How many types if DNS?
    There are two types of DNS servers
  • Authoritative DNS
  • Non-Authoritative DNS
4. What is DNS spoofing?
  • DNS spoofing is done by replacing the ip addresses stored in the  DNS server with the ones under the control of attacker.