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 #
- Domain typed: user enters
yourbusiness.lk. - DNS resolution: DNS returns an IP address.
- Connection: browser establishes a TCP connection and negotiates TLS (for HTTPS).
- Request: browser requests a page (GET /).
- Response: server returns HTML and references to CSS/JS/images.
- 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?