arrow_back Tech Stack & Hosting
DNS, IP addresses, and how a browser finds a server

DNS, IP addresses, and how a browser finds a server

Module Overview

Before you touch a server, you need to understand what the internet is actually doing when someone visits your website.

Most developers have gaps here - they deploy code without understanding the journey it takes from a browser to a server and back. These gaps become expensive when something breaks.

By the end of this module you will:

  • Understand how DNS translates a domain name into an IP address
  • Know what happens inside every HTTP and HTTPS request
  • Choose the right hosting model for your use case
  • Compare VPS providers available in South Africa
  • Provision your first live VPS

Lesson 1: DNS, IP Addresses, and How a Browser Finds a Server

Every Device Has an Address

Every device connected to the internet has an IP address - a unique numerical identifier.

Example:

196.22.1.45

IPv4 addresses are four groups of numbers from 0 to 255. IPv6 is the newer format with a larger address space, written as eight groups of hexadecimal values.

The Problem DNS Solves

Humans cannot remember IP addresses. Domain names are the solution.

DNS (Domain Name System) is a globally distributed database that maps domain names to IP addresses.

academyai.co.za  >  196.22.1.45

The DNS Resolution Journey

When you type a domain into your browser:

1. Browser checks its local DNS cache
   > Found? Use it. Done.

2. Browser asks the operating system's DNS resolver
   → Found in OS cache? Use it. Done.

3. OS queries the configured DNS server (usually your router or ISP)
   >  Found? Return it. Done.

4. If not cached, a full recursive lookup begins:

   a. Query a Root Name Server
      >  Returns the address of the .co.za TLD name server

   b. Query the .co.za TLD name server
      >  Returns the address of the domain's authoritative name server

   c. Query the authoritative name server (your DNS host, e.g. Cloudflare)
      >  Returns the A record: the actual IP address

5. Browser connects to the IP address

The entire process typically completes in under 100 milliseconds.

TTL - Time to Live

Every DNS record has a TTL value in seconds. This is how long resolvers cache the record before re-querying.

`academyai.co.za `   A    196.22.1.45    TTL: 3600

A TTL of 3600 means DNS changes take up to one hour to propagate globally. Lower it to 300 before making DNS changes, then restore it afterwards.

Key DNS Terms

Term Meaning
A Record Maps a domain to an IPv4 address
AAAA Record Maps a domain to an IPv6 address
CNAME Alias - points one domain to another
MX Record Specifies mail server for the domain
TXT Record Stores text data (SPF, DKIM, verification)
NS Record Specifies the authoritative name servers
TTL How long the record is cached in seconds

image