# How DNS Resolution Works part II

## What is DNS and why name resolution exists

**To learn the What is DNS and why name resolution exists** [Click here to learn part I](https://basicofgitwithranjan.hashnode.dev/how-dns-resolution-works?showSharer=true)

## What is the `dig` command and when it is used

> Dig means ***Domain Information Groper***. This is a Linux command Which is used For the retrieves information about DNS name servers.
> 
> ```plaintext
> dig urbanSaathi.com
> ```

## What `dig . NS` and root name servers

> ```plaintext
> dig google.com NS ns2.google.com
> ```
> 
> Output : —
> 
> ```plaintext
> google.com.   172800   IN   NS   ns2.google.com.
> ```

## what `dig com NS` and TLD name servers

> This used to `.com` level, DNS stores **NS records for second-level domains**.
> 
> ```plaintext
> dig com NS
> ```
> 
> output :—-
> 
> ```plaintext
> com.   NS   a.gtld-servers.net
> com.   NS   b.gtld-servers.net
> ...
> ...
> ...
> ```

## Understanding `dig` [`google.com`](http://google.com) `NS` and authoritative name servers

> it is asking **who is responsible** for answering all DNS questions about [`google.com`](http://google.com).
> 
> ```plaintext
> dig google.com NS
> ```
> 
> output :—
> 
> ```plaintext
> google.com.   172800   IN   NS   ns1.google.com.
> google.com.   172800   IN   NS   ns2.google.com.
> google.com.   172800   IN   NS   ns3.google.com.
> google.com.   172800   IN   NS   ns4.google.com.
> .........
> ```
