· Tutorial ·

Basic concepts about domains and DNS records

What Are DNS Servers?

The moment a user types a domain name into their browser, a series of internal requests are executed that ultimately translate 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 sent to a DNS server, which contains the domain’s information. Thus, the first step is to identify the domain’s DNS servers. Once the server with the correct information is identified, it is queried directly for the web server’s IP address.

Once the IP address has been ‘resolved’, a request is sent to the server (‘HTTP’ or ‘HTTPS’ request), and it responds with the webpage’s content.

Key Concepts

The Hostnames assigned to the domain (also called Nameservers): these are simply the names of one (or more) DNS servers responsible for converting the queried domain into an IP address.

Two or more servers will hold the information, which the user’s computer—when attempting to access ‘swhosting.com’—will use to 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 server stores all the information regarding the location of the server’s files, and the secondary server replicates the information from the primary server.

From the control panel used to manage our domain, such as SWPanel, we can modify our domain’s Hostnames at any time so that they point to a different DNS server (for example, if we change servers).

To modify your domain’s Hostnames in SWPanel, go to the ‘Domains and Certificates’ menu > ‘Domain Portfolio’ > the ‘···’ menu for the corresponding domain > ‘DNS Data’.

A domain’s Whois: you can check the Hostnames assigned to any domain via a WHOIS query, for example, on the ICANN website (the organization responsible for assigning names and numbers):

https://whois.icann.org/es (in the results, see the “Name Servers” section)

On Linux, you can perform this query directly from the terminal (in the results, see the “Name Server” section):

whois swhosting.com

Do not confuse the Hostnames/NS records assigned to your domain (those that appear in the WHOIS query) with the NS records of the DNS server. While they should be the same, they do not serve the same function.

DNS resolution: Once we know the domain’s hostname (DNS server), we can query it (or ‘resolve’) for any information about 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 types of DNS records:

The domain’s A record, which provides the IP address where the domain is hosted.

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

At the DNS server level, there are also NS records (Hostnames) intended to indicate which server is the authoritative server for the domain; however, this record does not determine who the query is directed to—as we saw earlier, it is the Hostname assigned to the domain that determines this.

TXT records allow you to add any text you want to the DNS zone and enable you to set up SPF, DKIM, and DMARC records, which we will explain below.

There are other DNS records, such as the MX record (Mail Exchanger), which defines the email server for the domain. There may be multiple MX records, depending on priorities.

Regarding email, there are a number of records designed to enhance its security, whether to verify that the sender is who they claim to be or to limit the spread of SPAM:

  • SPF records (Sender Policy Framework): Designed to protect against sender spoofing, they allow you to specify who can send emails from a given 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): An extension of the previous methods. It allows you to configure the policy for handling suspicious emails and generating reports.

Some of the major email providers (such as Gmail) require these rules to be in place in order 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 a computer or server.

i
Email send icon