Intro to Hosting - raisercostin/software-wiki GitHub Wiki

There are several things to configure in order to serve a http request to a user.

Solution

Buy domain & nameserver

My choice: http://namecheap.com - is simple to use and it has free nameservers, dns, WhoisGuard and URL Redirect Record.

Hosting

You have two options:

  • Buy hosting
  • Self hosting on your server
    • You have your IP. You should configure
      • A Record with your IP: A Record - @ - <IP> The @ symbol is used as the name of the current domain.
      • CNAME Record to catch all subdomains (subdomain.domain.gTLD ): CNAME Record - * - root domain

Hosted Services

  • The server could host ping. Then a ping domain and ping subdomain.domain should work.
  • The server could host a http proxy: nginx (recommended). Then any subdomain can be handled at http level by this server. See here how.

How it works

Ping

  1. A client ping hostname
  2. The client need to resolve the hostname to the IP
  3. It goes to the primary DNS server and asks about domain's IP. The dns server asks hierarchically till it reaches the domain registrar. The domain registrar returns the nameservers that know how to transform a hostname in an IP. Usually the domain registrar hosts also the nameservers but not always.
  4. The nameservers looks up the A records for the given hostname. If it finds an IP it returns it. The IP is returned also for subdomains.
  5. The client finally knows the IP and can now send packages to it according to the protocol (ping in this case)

Http

  1. Write darzar.com in the internet browser
  2. Chrome browser translates the entered address in the following way
    • If Settings > Use a web service to help resolve navigation errors is enabled darzar.com might be interpreted as a search if the hostname is not resolved to an IP.
    • If the hostname doesn't begin with www the browser automatically adds the www prefix and the request is made to www.darzar.com
    • If the hostname begins with http:// or https:// protocol like in http://darzar.com no change is made to the url
  3. Furthermore the browser considers the resolved url
  4. It asks the DNS server to resolve the hostname from rezolved url to an IP.
  5. Is doing an http/https request to http://IP:PORT with Request URL: **rezolved url** added in Http Header. In our case to the IP 46.4.100.49 and Request URL: http://darzar.com

Email

Spam

Sending

Receiving

References