From the moment a user types a domain in their browser, a series of internal requests are executed and they end up translating the domain name to an IP address, which is the address of the server that hosts the web page.
To have an IP address, a query is made internally to a DNS server that contains the domain information. Therefore, the first step is to identify which are the domain's DNS servers. Once the server that has the correct information is identified, the IP address of the web server is directly asked.
Once the IP address has been resolved, the server is asked ('HTTP' or 'HTTPS' request) and it responds with the content of the web page.
The Hostnames assigned to the domain (also called Nameservers or Name Servers): This is not more than the name of one (or several) DNS servers in charge of transforming the consulted domain in IP.
Two or more servers will have the information with which the user's computer that wants to enter 'swhosting.com' will locate the domain in question. At least there should be two registers (two servers): the primary or 'Master' and the secondary or 'Slave'. The primary is the one that hosts all the information of the location of the files of the server while the secondary one is the one that replicates the information of the primary server.
From the panel responsible for managing our domain, such as SW Panel, we can modify at any time the Hostnames of our domain so that they point to a different DNS server (for example, in case of changing servers).
To modify the Hostnames of your domain in SW Panel, access the menu 'Domains and Certificates' > 'Domain portfolio’ > '···' tab of the corresponding domain > 'DNS Data'.
The Whois of a domain: It is possible to check the Hostnames assigned to any domain through a WHOIS query, for example, on the ICANN website (organization responsible for assigning names and numbers):
https://whois.icann.org/es (of the result, see section "Name Servers")
In Linux you can make this query from the terminal itself (from the result, see section "Name Server"):
Do not confuse the Hostnames/NS records assigned to our domain (those that appear in the Whois query), with the NS records of the DNS server. Although they must be the same, they do not fulfill the same function.
The DNS resolution: Once we know the Hostname (DNS server) of the domain, we can consult (or 'resolve') any information about the domain. The requests can be from A record or the 'www' record (associated with web page), the MX record (associated with the mail), SPF (associated with sending mail)...
The A record of the domain, which provides the IP where the domain is hosted.
For its part, the CNAME record (Canonical Name), allows to identify aliases or subdomains equivalent to a domain. For example, 'swhosting.com' is the same as 'www.swhosting.com', being the CNAME 'www'.
At the DNS server level there are also NS records (Hostnames) in order to inform which is the authoritative server for the domain, but this record does not determine to whom the query is made, but, as we have seen previously , it will be the Hostname assigned to the domain that determines it.
The TXT records allow you to add the text you want to the DNS zone, allowing you to establish, among others, the SPF, DKIM and DMARC records that we will explain next. There are other DNS records such as MX record (Mail Exchanger), in charge of defining which is the email server for the domain. There may be several MX records, according to priorities.
In relation with the email, there are a series of records destined to increase the security of the same, either to certify that the sender is who he says he is, as to limit the diffusion of SPAM:
Some of the most important email providers (such as Gmail) require the presence of these rules to exchange email with them.
In summary, "Hostnames" and "DNS" are the mechanism for translating domain names into a set of numbers that form the IP address of the computer or server.