Basic concepts about domains and DNS records

Atualizado em 2026-10-22 19:02:06 1522 visitas

What is DNS?

From the moment a user types a domain into their browser, a series of internal requests are executed that end up translating the domain name into an IP address, which is the address of the server hosting the website.

To obtain an IP address, an internal query is made to a DNS server, which contains the domain information. Thus, the first step is to identify which DNS servers are associated with the domain. Once the server with the correct information has been identified, it is asked directly for the IP address of the web server.

Once the IP address has been 'resolved', the server is queried ('HTTP' or 'HTTPS' request) and it responds with the content of the website.

Key Concepts

The Hostnames assigned to the domain (also called Nameservers): this is nothing more than the name of one (or several) DNS servers responsible for transforming the queried domain into an IP.

Two or more servers will have the information with which the computer of the user who wants to enter ‘swhosting.com’ will locate the domain in question. There must be at least two records (i.e., two servers): the primary or ‘Master’ and the secondary or ‘Slave’. The primary is the one that houses all the information regarding the location of the server files, and the secondary is the one that replicates the information from the primary server.

From the panel in charge of managing our domain, such as SWPanel, we can modify the Hostnames of our domain at any time so that they point to a different DNS server (for example, in case of changing servers).

To modify your domain's Hostnames in SWPanel, access the 'Domains and Certificates' menu > 'Domain Portfolio' > '···' menu of the corresponding domain > 'DNS Data'.

The Whois of a domain: it is possible to consult the Hostnames assigned to any domain through a WHOIS query, for example, on the ICANN website (organization in charge of the assignment of names and numbers):

https://whois.icann.org/es (from the result, see the 'Name Servers' section)

In Linux, you can perform this query from the terminal itself (from the result, see the 'Name Server' section):

whois swhosting.com

Do not confuse the Hostnames/NS records assigned to our domain (those appearing in the Whois query) with the NS records of the DNS server. Although they should be the same, they do not perform the same function.

DNS resolution: Once we know the Hostname (DNS server) of the domain, we can query it (or 'resolve') any information regarding the domain. Requests can be for the A record or the 'www' record (associated with the website), the MX record (associated with email), SPF (associated with email sending), ...

Most common DNS record types:

The A record of the domain, which provides the IP where the domain is hosted.

The CNAME record (Canonical Name) allows the identification of aliases or subdomains equivalent to a domain. For example, ‘swhosting.com’ is equal to ‘www.swhosting.com’, with the CNAME being ‘www’.

At the DNS server level, there are also NS records (Hostnames) for the purpose of informing which is the authoritative server for the domain, but this record does not determine to whom the query is made; instead, as we have seen previously, the Hostname assigned to the domain will determine it.

TXT records allow you to add any text you wish to the DNS zone and allow the setup of SPF, DKIM, and DMARC records, which we will explain below.

There are other DNS records such as the MX record (Mail Exchanger), responsible for defining which is the email server for the domain. There may be several MX records, based on priorities.

Regarding email, there is a series of records intended to increase its security, either to certify that the sender is who they claim to be or to limit the spread of SPAM:

  • SPF records (Sender Policy Framework): Intended to protect against sender spoofing, it allows specifying who can send emails from a particular domain.
  • DKIM records (Domain Keys Identified Mail): Allows the recipient to unequivocally verify that the sender is who they claim to be.
  • DMARC records (Domain-based Message Authentication, Reporting and Conformance): Extension of the previous methods. It allows configuring the action policy for suspicious emails and the generation of reports.

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 translation mechanism from domain names to a set of numbers that form the IP address of the computer or server.