Back to Blog

Subdomain Inception: How gov.lk Goes Multiple Levels Deep 🌐

October 27, 2025 (3w ago)
👁️ ... views

🎯 How It Actually Works

Think of it like an address system:

gov.lk (main domain)
└── moe.gov.lk (Ministry of Education)
    └── ethaksalava.moe.gov.lk (e-Thaksalawa platform)
        └── cdn.ethaksalava.moe.gov.lk (CDN server)

Each level is just another DNS record. That’s it. No special permissions needed.


⚙️ Key Features


💡 Why This Is Important

If you’re building anything beyond a basic website, subdomains are essential:

Knowing this makes you look way more professional to clients. It’s that infrastructure-level knowledge that separates amateurs from pros. 💯


🛠️ How to Set It Up

Go to your DNS provider (Cloudflare, Namecheap, etc.) and add records like this:

Type    Name                        Value
A       imrishmika.site            203.0.113.1
A       cdn.imrishmika.site        203.0.113.2
A       edge.cdn.imrishmika.site   203.0.113.3

Or use CNAME for aliasing:

Type     Name          Value
CNAME    cdn           imrishmika.site
CNAME    edge.cdn      cdn.imrishmika.site

Wait පැයක් විතර for DNS propagation... then boom! ✅ Your multi-level subdomains are live.


💭 My Take

Honestly, the fact that DNS can handle infinite nesting is both powerful and dangerous. It’s powerful because you get insane flexibility. It’s dangerous because some devs go overboard and end up with stuff like:

api.v2.staging.internal.backup.legacy.oldapp.com 😭

What I actually respect about the gov.lk setup is its logical hierarchy — each level actually means something: ministry → department → service → infrastructure. That’s clean architecture right there. 🧩

For your own projects: keep it simple — 2 or 3 levels max unless you genuinely need more.

The real power is understanding that subdomains aren’t magic — they’re just DNS records pointing to different IPs or services. Once you get that, you realize how much control you actually have. 🔥


💬 Your domain = your digital real estate. Subdomains = free floors you can build on top. Use them wisely, build them smartly! 🏗️