KatInterview

Multi-Domain Web Hosting on a Single IP Address

System DesignModel answer
MediumModel answerSystem Designnetworkingweb-infrastructuredns

Last updated

Design a solution to serve three independent websites with separate domain names from one server with a single public IP address.

You're tasked with deploying websites for three independent small businesses—a café, a flower shop, and a bookstore—on a single Linux server that has only one public IPv4 address. Each business needs its own domain name (for example: cafe.com, flowers.com, books.com).

Design an architecture that enables all three websites to coexist on this shared infrastructure.

Your solution should address:

  1. DNS configuration — How do you point multiple domain names to one IP?
  2. Request routing — How does the server determine which site a visitor wants when HTTP/HTTPS requests arrive?
  3. Certificate handling — How do you secure each site with HTTPS?
  4. Operations and security — What isolation, monitoring, and deployment practices would you implement?

Explain the technical mechanisms that make this possible and discuss practical trade-offs.

Hints

Hint 1

Think about what information browsers send that identifies which domain they're trying to reach

Hint 2

TLS handshakes happen before HTTP headers can be read—how does the server pick the right certificate?

Hint 3

Consider how to prevent one site's issues from affecting the others