Note: Most of these blogs are for my personal reference and at a given time, some of those might just be unpolished drafts.

On Domain And DNS

This github page

This blog is a github page based on jekyll now and the URL as per github convention is (It’s unless you set up a custom domain.

As of Jan 2020, I have a custom domain setup for this at I had some insights into internet domains, dns and domain resolution while doing this activity.

How are domains organized?

All the internet domains are organized in a hierarchical fashion. In my case the descending order of hierarchy would be:

. : root hierarchy (every domain is suffixed with dot)

wtf : top level 

www.sudipbhandari : second level

What happens when you browse?

When you hit a domain in browser it first hits the configured dns server (usually google’s dns server at Practically there is a lot of caching involved in local computer as well as dns server. This query is generally a UDP query (Query Response protocol) and not TCP. After a series of queries (queries traverse down the hierarchy: root->top-level->second-level….) you finally get A record (IP) [which could be preceeded by Cname (Alias for your domain)] and then the browser makes the request to the particular IP.

Testing My DNS Resolution

I used dig which is a DNS look-up utility to, quite literally, dig up my DNS information. I took google’s DNS server for this purpose which is at

dig @ +trace
#+trace show the steps in each process of hierarchical querying

Each of the following steps is hierarchical. Step 1 gives authoratative server to which subsequent step has to be queried against until we have the IP address.

  • Step 1: It queries the root domain server
; <<>> DiG 9.11.3-1ubuntu1.11-Ubuntu <<>> @ +trace
; (1 server found)
;; global options: +cmd
.			298	IN	NS
.			298	IN	NS
.			298	IN	NS
.			298	IN	NS
.			298	IN	NS
.			298	IN	NS
.			298	IN	NS
.			298	IN	NS
.			298	IN	NS
.			298	IN	NS
.			298	IN	NS
.			298	IN	NS
.			298	IN	NS

As mentioned earlier, we can see that the root domain is dot(.)

  • Step 2: It queries for top domain (wtf in my case)
Received 525 bytes from in 163 ms

wtf.			172800	IN	NS
wtf.			172800	IN	NS
wtf.			172800	IN	NS
wtf.			172800	IN	NS
  • Step 3: It queries for second level domain (
;; Received 717 bytes from in 181 ms	86400	IN	NS	86400	IN	NS	86400	IN	NS
  • Step 3: Now it queries for FQDN (Fully qualified domain name)	300	IN	CNAME
;; Received 90 bytes from in 214 ms

At this step we get a C-Name record. This is because I have set up an alias for at my domain provider ( as of Jan 2020). (Setting alias like requires changes on both domain provider side to add entry as well as your site (where you identify yourself as such)). (Otherwise you can imagine I could set up a domain and redirect it to

  • Step 4: We still don’t have IP. So the finally query gets the IP (A record)	299	IN	CNAME 2531 IN	A 2531 IN	A 2531 IN	A 2531 IN	A

(4 Different IPs at github for this github page to load balance the traffic, make fault tolerant)

We can check the domain details of any domain (which is the registrar, when does it expire, when was it last updated, etc) by querying whois directory service. Against my domain I get the following output:

 whois                               sudipbhandari@sudipbhandari-Latitude-5480
Domain Name:
Registry Domain ID: ae07b5b17a0e481fb88fbeec97475175-DONUTS
Registrar WHOIS Server:
Registrar URL:
Updated Date: 2020-01-21T18:29:01Z
Creation Date: 2020-01-16T18:28:48Z
Registry Expiry Date: 2021-01-16T18:28:48Z
Registrar:, Inc.
Registrar IANA ID: 625
Registrar Abuse Contact Email:
Registrar Abuse Contact Phone: +7.202492374
Domain Status: clientTransferProhibited
Registry Registrant ID: REDACTED FOR PRIVACY


whois                                      sudipbhandari@sudipbhandari-Latitude-5480
   Domain Name: GOOGLE.COM
   Registry Domain ID: 2138514_DOMAIN_COM-VRSN
   Registrar WHOIS Server:
   Registrar URL:
   Updated Date: 2019-09-09T15:39:04Z
   Creation Date: 1997-09-15T04:00:00Z
   Registry Expiry Date: 2028-09-14T04:00:00Z
   Registrar: MarkMonitor Inc.
Written on January 24, 2020