dns

DNS, Stands for  Domain Name System, is a fundamental component of web hosting that plays a crucial role in translating human-readable domain names into numerical IP addresses.DNS is all about looking up addresses and connecting devices, many people call DNS the “phonebook of the Internet”. Without DNS, you’d have to memorize every site’s IP address to access it. The  system enables users to access websites using easy-to-remember domain names rather than having to remember the numerical IP addresses associated with each web server.

When a user enters a URL in their web browser, DNS gets to work to connect that URL to the IP address of the actual server. This is called DNS name resolution and involves a  querying various name servers to figure out the actual IP address of a server.

dns

 

Key Components of DNS in Web Hosting:

  1. Domain Names:
    • A domain name is the human-readable address that users type into their web browsers to access a website. For example, www.example.com is a domain name. Each domain is associated with a unique IP address, which is the actual numerical identifier of the server hosting the website.
  2. IP Addresses:
    • Every device connected to the Internet, including web servers, is assigned a unique numerical IP address. IP addresses are used to identify and locate devices on the network. In the context of web hosting, the IP address points to the server where the website’s files and data are stored.
  3. DNS Servers:
    • DNS operates using a distributed hierarchy of  servers. These servers are responsible for storing and providing access to the records that map domain names to IP addresses. There are various types of  servers, including authoritative  servers, recursive  servers, and root  servers.
  4. DNS Records:
    • DNS records are the data entries stored on DNS servers. The most common DNS record types include:
      • A Record (Address Record): Maps a domain to its corresponding IP address. The A record is the most important record type. The “A” in A record stands for “address.” An A record shows the IP address for a specific hostname or domain.
      • CNAME (Canonical Name): CNAME—or, in full, “canonical name”—is a DNS record that points a domain name (an alias) to another domain. Alias of one domain to another (used for subdomains or domain aliases). In a CNAME record, the alias doesn’t point to an IP address
      • MX Record (Mail Exchange): Specifies the mail servers responsible for receiving email on behalf of the domain.A mail exchange (MX) record, is a DNS record type that shows where emails for a domain should be routed to.
        • NS Record (Name Server): Identifies authoritative  servers for the domain.A nameserver (NS) record specifies the authoritative DNS server for a domain. In other words, the NS record helps point to where internet applications like a web browser can find the IP address for a domain name.
        • TXT Record (Text Record): Contains arbitrary text, often used for verification or information purposes. Most commonly, TXT records are used to associate SPF records with a domain to improve email deliver ability and protect against spammers misusing the domain name when sending out spam.

dns

How DNS Works in Web Hosting:

  1. User Enters a Domain Name:
    • When a user enters a domain name (e.g., www.example.com) into a web browser, the browser initiates a  lookup to find the corresponding IP address.
  2. Local DNS Resolver:
    • The user’s device first checks its local  resolver cache to see if it has a recent record of the IP address associated with the domain. If found, the browser can use this cached information and proceed to access the website.
  3. Recursive DNS Server:
    • If the local cache does not contain the necessary information, the user’s device sends a request to a recursive DNS server. This server may be provided by the Internet Service Provider (ISP) or a third-party DNS service. The recursive server is responsible for finding the IP address by querying other DNS servers in the hierarchy.
  4. Root DNS Server:
    • If the recursive DNS server does not have the IP address information, it contacts a root  server. The root DNS servers are the starting point of the DNS hierarchy and provide information about the authoritative DNS servers for top-level domains (TLDs).
  5. TLD DNS Server:
    • The root DNS server directs the recursive DNS server to the appropriate TLD  server based on the top-level domain of the requested domain name (e.g., “.com” or “.org”). The TLD DNS server holds information about the authoritative DNS servers for second-level domains.
  6. Authoritative DNS Server:
    • The TLD  server provides the IP address of the authoritative DNS server for the specific domain. The authoritative DNS server is the final authority on the mapping between the domain name and its corresponding IP address.
  7. Return IP Address:
    • The recursive DNS server returns the IP address to the user’s device, which caches this information for future use. The user’s device can now use the IP address to establish a connection with the web server hosting the requested website.
  8. Website Access:
    • With the IP address obtained through the DNS lookup, the user’s browser establishes a connection with the web server, and the requested web page is delivered to the user.