Skip to content

Instantly share code, notes, and snippets.

@xpcoffee
Last active August 29, 2015 14:09
Show Gist options
  • Save xpcoffee/9e6e99cc64823833f7a1 to your computer and use it in GitHub Desktop.
Save xpcoffee/9e6e99cc64823833f7a1 to your computer and use it in GitHub Desktop.
Domain Name System

##Domain Name System (DNS)

This is the system that allows a pc to navigate to the right page on the internet.

###The Nature of Internet Addresses Addresses on the internet are actually IP addresses (Internet Protocol) like 74.125.228.200 - Google.

IP is well defined and standardized and it has proven to be a reliable method for locating individual devices within large networks. Browsers and computers have these standards coded in them and can use them quickly and efficiently to find and communicate with each other.

However, IP addresses are not human-friendly. Lists of four numbers are hard to remember and do not give any information about the nature of the site, for example:

  • 54.243.122.68 - Git SCM
  • 192.30.252.129 - Github

This can lead to many problems: - it is easy to make a mistake. 75.126.228.200 seems very close to Google's address, but will open up a completely different website. - if a website needs to change its address, everyone must first be notified of the change then each person must memorize the new, completely different, IP address in order to access the site at its new location.

Because of problems like this, a system was created to allow IP addresses to be found by using strings - which are much more human-friendly:

  • www.google.com. - Google
  • www.git-scm.com. - Git SCM
  • www.github.com. - Github

(notice that these all end in a dot)

These are both easier to remember, and give information about the site you are visiting.

The Domain Name System is the collection of standards and processes that find the IP address of a website or device using these alpha-numeric addresses.

###DNS Procedure

If we want to find the webpage: www.example.com

#####1. Browser and OS: (www.example.com)

  • try to see if address is configured on the computer or if it is in cache
  • if address is not known, the OS will query a Resolving Name Server

#####2. Resolving Name Server: (www.example.com.)

  • is what queries other servers through the net trying to find the webpage
  • stores IP addresses in cache
  • tries to see if it has the website address in cache
  • if it does not, it queries a Root Name Server (RNS), which is signified by a dot at the end of the address

#####3. RNS: www.example.com(.)

  • is the server that holds the locations of Top Level Domain (TLD) Name Servers which hold top level domain names like com, org and za
  • the correct one is found and the address of the server is given to the Resolving Name Server

#####4. TLD Name Server: www.example.(com).

  • stores the locations of Authoritative Name Servers (ANS) that hold the authoritative names of the websites (in this case, "example")
  • the correct one is found and the address of the server is given to the Resolving Name Server

TLD servers (in the US) are maintained by the Registry. In order to register a new authoritative name (new website), the domain name is registered with the Registrar (here is where the transaction is managed, filed, etc.) and the Registrar contacts the Registry to tell it to update the TLD servers to include/ammend the authoritative name.

#####5. ANS: www.(example).com.

  • stores the locations of all pages on the website with that authoritative name
  • gives the address to the Resolving Name Server

#####6. Resolution

  • the Resolving Name Server then gives the address back to the OS, which gives it to the browser
  • the browser then connects to the address and communicates with the device or website
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment