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
- A Record with your IP:
- You have your IP. You should configure
Hosted Services
- The server could host ping. Then a
ping domain
andping 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
- A client ping hostname
- The client need to resolve the hostname to the IP
- 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.
- 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.
- The client finally knows the IP and can now send packages to it according to the protocol (ping in this case)
Http
- Write
darzar.com
in the internet browser - Chrome browser translates the entered address in the following way
- If
Settings > Use a web service to help resolve navigation errors
is enableddarzar.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 thewww
prefix and the request is made towww.darzar.com
- If the hostname begins with
http://
orhttps://
protocol like inhttp://darzar.com
no change is made to the url
- If
- Furthermore the browser considers the resolved url
- It asks the DNS server to resolve the hostname from rezolved url to an IP.
- Is doing an http/https request to
http://IP:PORT
withRequest URL: **rezolved url**
added in Http Header. In our case to the IP46.4.100.49
andRequest URL: http://darzar.com
Spam
- email tester https://www.mail-tester.com/
Sending
Receiving
References
- url host:
subdomain.domain.gTLD
- gTLD - generic top level domain: com, biz, net, org, ...
- root domain -
- subdomain -
- read more at https://moz.com/blog/understanding-root-domains-subdomains-vs-subfolders-microsites
- path