What is Domain Name System and How Does it Work?

What is Domain Name System and How Does it Work?

February 26, 2019 / Nirav Shah

Abstract

We go through the basics regarding what is a domain; what is a DNS Service; the basic requirements for DNS to work; various records that are used by DNS to note-down and remember back-end resources to which domains are pointed and various other things.

First lets just brush through the basics

What is a Domain

Domains are easy-to-remember words that point to a Server’s IP-address. e.g.:- www.google.com

What is a Domain Name System (DNS) ?

www.google.com is an easy to remember Domain name but, what if you did not have this name and instead you need to enter the Server’s IP-address to view google web page, which is 216.58.196.14. Now, it is obvious that remembering www.google.com is way easier than remembering 216.58.196.14; and the Internet does not understand www.google.com, it only serves requests if it receives the requests for 216.58.196.14.

So, the Service/System that translates your www.google.com to 216.58.196.14 so that you are able to view the google webpage, that is called Domain Name System (DNS). DNS manages a massive database that maps domain names to IP addresses.

Without DNS you will need to enter

216.58.196.14—for www.google.com
72.21.211.176—for www.amazon.com
46.51.179.90—–for duckduckgo.com
176.9.200.2——-for androidpit.com
157.240.194.35–for facebook.com

DNS makes Internet Surfing easy for the end user as it remembers all the ip-addresses pointing to respective domains so that neither end-user has to remember 46.51.179.90 nor does the Internet need to serve requests for duckduckgo.com.

How is DNS Service Managed ?

  • Each and every domain has a domain Name Server handling its requests, and there is a person or IT team maintaining the records in that DNS server’s database.
  • No other database on the planet gets as many requests as DNS servers, and they handle all those queries while also processing data updates from millions of people every day.
  • One of the most amazing parts of DNS is that it is completely distributed throughout the world on millions of machines, managed by millions of people, and yet it behaves like a single, integrated database

Next we will understand the different Records that DNS manages for it to resolve your domain name requests to the Server to which the domain name is pointed.

Different DNS Record Types

a vast majority of Record Types are available for DNS Management and they are listed below with a basic understanding of their ROLES in domain hosting.

  • A Record Type
    • Points to an IPv4 Address in dotted decimal notation.
    • e.g.:- 123.123.123.123
  • AAAA Record Type
    • Points to an IPv6 Address in colon-separated hexadecimal format.
    • e.g.:- 4337:8bd0:e2a8:3a58:1002:0:0730:0
  • CAA Record Type
    • lets you specify which certificate authorities (CAs) are allowed to issue certificates for a domain/subdomain.
    • It helps to prevent the wrong CAs from issuing certificates for your domains.
    • e.g. :- 0 issue “ca.example.net”
  • CNAME Record Type
    • It’s the same format as a domain name.
    • Majorly used to redirect one domain name request to another.
    • e.g:- google.com is a CNAME record pointing to www.google.com
  • MX Record Type
    • Each value for an MX record actually contains 2 values, Priority and Domain Name
      • Priority
        • An integer that represents the priority for an email server.
        • Can be any value between 0 and 65535
        • The lowest value has the highest priority
        • e.g.:- out of two mail servers with values 10 and 20 respectively; the mail server with value 10 will always receive the mails.
      • Domain Name
        • The Domain name of the email server.
        • e.g.:- mail.example.com
    • e.g
      • 0 mail1.example.com
      • 10 mail2.example.com
      • 20 mail3.example.com
  • NAPTR Record Type
    • Name Authority PoinTeR is used by Dynamic Delegation Discovery System (DDDS) Applications to convert one value to another or to replace one value with another.
    • One common use is to convert phone numbers into SIP URIs.
    • e.g.:- {100 50 “u” “E2U+sip” “!^(\\+441632960083)$!sip:\\1@example.com!” .} the “.” is also a value.
  • NS Record Type
    • Identifies the Name Servers for the Hosted Zones.
    • DNS looks at the NS records to work out who to ask next when resolving a domain name request.
    • The value for an NS record is the domain name of a name server.
    • e.g.:- ns-1.example.com
  • PTR Record Type
    • A PoinTeR record resolves an IP address to a Fully-Qualified Domain Name (FQDN).
    • Also called as Reverse DNS records due to their functionality.
    • Mainly used to check if the server name is actually associated with the IP address from where the connection was initiated.
    • Every Mail Server compulsorily needs a PTR Record for it to pass security tests when connecting to other mail servers to send receive mails.
    • Is the same format as a domain name.
    • e.g.:- hostname.example.com
  • SOA Record Type
    • Start Of Authority record provides information about the respective domain.
    • Information containing Primary Name Server, email-ID of the domain administrator, the domain serial number, and several timers relating to refreshing the zone.
    • e.g.:- ns-2048.awsdns-64.net hostmaster.awsdns.com 1 1 1 1 60
  • SPF Record Type
    • Sender Policy Framework is an open standard specifying a technical method to prevent sender address forgery.
    • e.g.:- “v=spf1 ip4:192.168.0.1/16 -all”
  • SRV Record Type
    • Custom DNS Records that are used to establish connections between a service and a hostname when an application needs to find the location of a specific service.
    • e.g.:- 10 5 80 hostname.example.com where “10” is Priority; “5” is weight; “80” is port No. and “hostname.example.com” is the domain.
  • TXT Record Type
    • Used to contain human readable information about a server, network, data center, and other accounting information.
    • These records aren’t used to direct any traffic, instead provide needed information to outside sources.

These provided record types might be available/unavailable to you for your domain hosting based on the Domain Hosting Provider that you have hosted your domain on.

Now that we have listed majority of Record types that DNS uses to register and route requests to the pointed Record Set, we will understand another vital functionality which keeps the DNS Service Working.

TTLs

  • TTL is short for Time To Live.
  • A DNS server that manages a specific domain is called the start of authority (SOA) for that domain. Over time, the results from looking up hosts at the SOA will propagate to other DNS servers, which in turn propagate to other DNS servers, and so on across the internet.
  • This propagation is a result of each DNS server caching the lookup result for a limited time, known as its Time To Live (TTL), ranging from a few minutes to a few days.
  • As DNS supports & manages this many types of Record Types it needs to specify a time interval for which it will freeze any particular record as changing the record type values every now and then will result in a broken Internet.
  • e.g. :- Suppose you specify an A-record 123.123.123.123 for your domain www.example.com then you also need to specify the TTL for which the DNS will freeze any changes to the same like for 86400 seconds (24 Hrs); then DNS will route all requests for www.example.com to the ip-address 123.123.123.123 for the next 24 Hrs after the record was created; now if you change the record before completing the 24 Hr TTL, the changes will be brought to effect only after the 24 Hr Freeze period.
  • Of Course the TTLs have reduced a lot since these many years of DNS technology development. Now, there are DNS Providers like AWS ROUTE-53 which allow you to set TTLs as low as 1 second.
  • One would think that why is it not possible to by default set TTL to as low as 1 second but, setting very LOW TTLs also have their drawbacks like; it causes heavier load on the DNS as then the Service will have to check for any updated records every 1 second which can reduce the efficiency of DNS Services if the service provider is limited on computing resources.

So, these was a basic understanding on a higher level regarding what is DNS, how it works, different functions that DNS provides as well as different types of records that can be used to point your domain to the backend servers/resources.

Talk to AWS Certified Consultant

    Spread Love By Sharing:

    Let’s Talk About Your Needed AWS Infrastructure Management Services

    Have queries about your project idea or concept? Please drop in your project details to discuss with our AWS Global Cloud Infrastructure service specialists and consultants.

    • Swift Hiring and Onboarding
    • Experienced and Trained AWS Team
    • Quality Consulting and Programming
    Let’s Connect and Discuss Your Project