What you need to know
What is DNS and how does it work?
Each domain has assigned DNS (Nameservers), allowing to translate the domain name to the corresponding IP.
DNS or Nameservers are names or domains that usually consist of two or more parts. An example of DNS would be the following:
ns5061.webempresa.eu
ns5062.webempresa.eu
¿What is DNS used for?
This translation is necessary because our website is hosted under an IP and why don’t we access the IP directly?
The problem with the IP is that it is much more complex to remember than a domain name and is more impersonal, so we use the domain name.
Servers involved in the DNS resolution
DNS resolver or primary server
This server is responsible for performing queries to other servers on behalf of the client.
Root Server
The root server is the one in charge of translating/resolving the domain name into an IP.
Also, the root server would be at the highest level of the DNS hierarchy.
This server will forward the agent to a more specific server.
TLD name server
The TLD name server is a specific server for top level domains (TLDs).
Authorized name server
The authoritative name server contains all the information about the domain name you want to access, serving the browser all the information requested from the web.
We will better understand the role played by each of them by looking at how DNS works.
We answer your questions
¿How does DNS work?
DNS comes into play from the moment you decide to visit a website.
The DNS comes into play from the moment you decide to visit a website.
For example, if we want to go to the webempresa.com website, we will have to type the domain name in the browser or in the search engine. Once the request to access the website has been made, the browser will need to know the IP address of the server where the website information is located.
To find out that IP, the browser will check if this information is in the DNS cache of the computer from which the request is made.
The DNS cache stores in a history the IP addresses of the websites that are visited from the computer, speeding up the process. If you do not have the IP address stored in your browser cache, you will have to make the request to the DNS server.
The query will be made to a primary DNS server (it will be your Internet provider). In the case that the information is not on that server, you will have to query other DNS servers.
The first query will be to the root server (in charge of the TLD domains). This one will answer you by telling you which server has delegated the authority over the .com domains.
The second query will be about the authoritative server to which the root server delegated the information.
Once the browser has the IP of the web server where the domain information is located, it will only have to go to that address to extract the information.
DNS record types
For domain name resolution, DNS records must be looked up in the DNS server’s database. Within these records we can find several different types with different functions:
- A record: In most cases DNS resolution is done through this registry, it contains the iPv4.
- AAAA record: They are similar to the A register, but instead of using iPv4 they use iPV6.
- SOA record: this register contains information about the zone transfer, which is responsible for the continuous propagation of DNS.
- CName record: contains an alternative authentic domain name (an alias), pointing to another A or AAAA record.
- MX Record: Identifies the mail server.
- NS Record: They are in charge of communicating the DNS information of a domain.
- TXT record: Allows to include information in text format.
- SRV record: Used to add specific data about the domain name system such as name, priority, etc.
- LOC record: With this type of record you can specify the physical location of the server.