Setting up DNS

You need first to understand basis about how works DNS and name server. Else go directly to Choosing between...

 

The point to remember:

The domain name is used for both IP query and Virtual Host selection but these are two independant processes.
It is MANDATORY to setup BOTH DNS nameserver AND web service for each new domain or sub-domain handled by a server.
- DNS nameserver is setup by registrar panel or Sentora DNS Manager module, depending of configuration choosen (see Choosing between... ),
- Web service is setup by Sentora Domains or Sub-Domains module.

 

Some explanation about how it works:

All clients applications (browser, ftp, game, mail, etc.) that want to query a server works the same way:

1) The client must know the server IP. -> handled by DNS server.

On the world wide internet, a requests can be sent only to an IP. When a client knows only the domain name of the server, it have to find the corresponding IP.
It sends the target domain (or sub-domain) name to a DNS server --> DNS server responds the IP --> Client receive the IP.

For this step, nothing about target port or service is mentioned ; the DNS server does not know anything about them.

Remember that a DNS server only responds to request like "What is the IP for this domain name". (For the scope of this tuto. A DNS server have also to synchronize to redondant servers, to maintain name caches and many other functions to work properly, but it is another story).
 

2) When a request arrive to the target IP, the server must know which service will handle the request -> handled by port affectation

Each server can hosts many services (web, emails, game, voice call, etc)

The client send a request to the IP + Port --> inside the server at IP, the service that listen the Port tries to handle the request from what it is supposed to contain.

For this step, only IP+Port is used, the target domain name is not involved. The request may contain a domain name, like with HTTP, but it is INSIDE the request and has nothing to do about how the request is transported or dispatched to service. It is not the same OSI layer.

Some ports have standardized number : 80 for website, 21 for ftp, 25565 for minecraft server, etc., but you can define another port number, until the client knows it.
The most often, both client and server application enable to change used port through a config file. Changing port number from "standard" is also an easy protection against hacks when you are sharing a service only with people whom you can tell the port number to use.
 

3) When a service works for multiple hosts, it have to know for which virtual host the request is  -> handled by the protocol.

This apply only if the service handles multiple "virtual hosts". It may use a domain name (usually the same than point 1) but it have here absolutely not any relation with DNS. Some examples:

  • for websites (http, https), the request header sent by the browser contains the domain name to serve. It is stripped by the web server (ie apache) to select the "virtual host"
  • for ftp, ssh, the user name is used to select  the "virtual root directory" assigned to that user.
  • for minecraft, a server handle only one world, there are not any "virtual world".

Some servers (like Apache) can listen multiple ports to handle multiple vitual hosts selected from port rather than from domain name, but it is not often used (example : used on Synology NAS, each virtual host is acceeded by IP + Port).

When a service does not handle multiple virtual hosts, but the admin wants to host many, it would be possible to launch many instances of the same service on single server, each working with a separate setup and listening a separate port. It would work, but would also multiply the load of the server and the amount of RAM used.

 

Note about TTL (Time To Live):

TTL is the period in seconds during which each DNS server around the world will maintain its own copies of your records in its cache. After a first DNS request, all node of the internet will not read again your domain nameserver until its cache expired.

Set it shorter (ie 1 hour) if you plan to change some DNS settings, set it longer (usualy a 4 to 48 hours) to lighten the load of all nemeserver and proxies around the world, and to speedup your domain access time.

After a changing some settup of a domain, you can follow the propagation in the world DNS servers on that page http://www.whatsmydns.net

 

WARNING :

  • each change done to a nameserver needs time to be propagated to all nameservers around the world.
  • NEVER apply changes about which you are not sure they are correct. Check them 2 times, and then 1 time again !

 

PenWant to help ? Click here to report mistake or to send complement to add.