How Websites Actually Work (DNS → Server → Browser) – Sri Lanka Friendly Explanation

How Websites Actually Work (DNS → Server → Browser) – Sri Lanka Friendly Explanation #

Clear definition #

When you open a website, your browser uses DNS to find the server IP address, connects to that server using HTTP/HTTPS, downloads the required files, and then renders the page on your screen.

The end-to-end flow #

  1. Domain typed: user enters yourbusiness.lk.
  2. DNS resolution: DNS returns an IP address.
  3. Connection: browser establishes a TCP connection and negotiates TLS (for HTTPS).
  4. Request: browser requests a page (GET /).
  5. Response: server returns HTML and references to CSS/JS/images.
  6. Rendering: browser builds the page and loads supporting files.

DNS: the part that often causes confusion #

DNS is like a directory. Common records:

  • A record: domain → IPv4 address
  • CNAME: one name → another name (often www → root)
  • MX: where email should be delivered
  • TXT: verification and email security (SPF/DKIM/DMARC)

Static vs dynamic websites #

Static #

Server returns files directly (HTML/CSS/JS). Faster and simpler.

Dynamic (WordPress etc.) #

Server runs code (PHP) and queries a database to generate HTML. This can be fast if optimized, but it requires more resources and good caching.

Where issues happen (troubleshooting map) #

  • Domain expired: DNS may stop resolving.
  • Wrong DNS: domain points to the wrong server.
  • Hosting down: server doesn’t respond.
  • SSL issues: HTTPS warnings or failures.
  • App errors: WordPress/PHP errors (500 error, white screen).

Sri Lanka context: caching and “it works for me” problems #

Sometimes a site works on one network but not another because DNS caches differ between ISPs. Test using mobile data and Wi‑Fi, and allow time for propagation after DNS changes.

Related guides #

  • Hosting vs Domain Name – What’s the Difference?
  • DNS Propagation Explained (Sri Lanka context)
  • What Affects Website Speed in Sri Lanka?

What are your feelings

Updated on මාර්තු 3, 2026