What is DNS?
DNS, or Domain Name System, is a service that helps translate domain names into IP addresses. When we visit a website, we rely on DNS to find the server where the website is hosted. For example, when we type a domain name like www.google.com into our browser, it’s easier to remember than trying to recall the associated IP address of Google’s server.
Behind the scenes, DNS converts www.google.com into an IP address, such as 172.217.12.46. This IP address identifies the location of the server on the Internet. The process of converting the domain name to an IP address is known as a query. This conversion is an essential part of how devices communicate and connect with one another over the internet. To fully understand the query process, let’s take a closer look at how it works.
How Does the DNS Process Work?
Step 1: Requesting Website Information
When you type a domain name like www.BrawHosting.com into your browser, your computer looks for the hostname. It first checks its local DNS cache for the IP address linked to that domain. If it finds the IP address, the website loads. If not, the computer sends a DNS query to get the correct information.
Step 2: Contact the Recursive DNS Servers
If the local cache doesn’t have the needed information, the computer contacts a recursive DNS server. These servers store cached information. Many ISPs use the same recursive servers. If the domain is in the server’s cache, the server sends the IP address back and the website loads.
Step 3: Query the Authoritative DNS Servers
If the recursive server doesn’t have the information, it sends the query to the authoritative DNS servers. These servers store records for their domain names. The query keeps going until it finds an authoritative nameserver.
Step 4: Access the DNS Record
To find the IP address for BrawHosting.com, the query goes to the authoritative nameserver. The recursive server gets the (A record) (Address record) from that server. The record is stored in the recursive server’s cache. The next time the same domain is queried, the server can use the cached information. Each DNS record has a time-to-live (TTL) value. This tells the server when to get new records.
Step 5: Final DNS Step
After the recursive server gets the A record, it sends it to your computer. The computer saves the record in its cache. The IP address goes to your browser. The browser connects to the web server for that IP and loads the website.
DNS Servers
Authoritative DNS Server
An authoritative DNS server stores DNS records (like A, CNAME, MX, TXT) for domain names. These servers only respond to queries for records stored in their local DNS zone files. For example, if a server in our network has an A record for example.com, that server is the authoritative server for example.com.
Recursive DNS Server
A recursive DNS server is a server that handles queries for information. It does not store DNS records. When a query is received, the server first checks its cache for the IP address linked to the domain. If it has the information, it will respond with the IP address. If it doesn’t, the query is sent to other recursive servers. This process continues until it finds an authoritative DNS server that can provide the IP address.
DNS Zones
A DNS zone is an area within the Domain Name System. It is delegated to administrators or entities to manage. Each zone holds the resource records for all the domains within it.
DNS Zone File
A DNS zone file is a text file on a server. It contains all the DNS records for the domains within that zone. The TTL (Time to Live) must be listed first in the file. The TTL defines how long a record stays in a server’s cache. Each line in the file contains one record. The file begins with the Start of Authority (SOA) record, which includes key information about the domain, such as the primary authoritative nameserver for the zone.
DNS Record Types
DNS records are stored in authoritative servers. These records provide information about a domain, including the IP address linked to it. Every domain must have a specific set of default records. Below are the most common record types.
A (Address) Record
An A record links a domain name to an IP address. For example, when you type www.google.com in a browser, the DNS system uses the A record to translate the domain name to the IP address 172.217.12.46, where Google’s website files are hosted.
CNAME (Canonical Name) Record
A CNAME record redirects one domain name to another. This record does not contain an IP address. It can only be used if no other records exist for that domain. For example, www.google.com can be redirected to google.com, but not to a different domain like gmail.com.
MX (Mail Exchanger) Record
An MX record directs email messages to a specific mail server. If a domain uses multiple mail servers, the MX record uses a priority system. The lower the priority number, the higher the priority. For example, an MX record with priority 10 will be used first, and priority 20 will act as a backup if priority 10 is unavailable.
TXT (Text) Record
A TXT record provides information about a domain. It is often used for verification purposes, like confirming that an email message is from the correct server. An example is a Sender Policy Framework (SPF) record, which helps verify the sender’s server.
NS (Name Server) Record
An NS record identifies which DNS server is authoritative for a domain. It points to the server that holds the domain’s current records. The highest level of authority comes from the 13 top-level DNS servers, which contain all active records for every domain. These servers share DNS information with other servers, like those at registrars, ISPs, and hosting companies.
SOA (Start of Authority) Record
The SOA record is a DNS record that provides important information about all the DNS records in a specific zone. It includes the following details:
- The name of the primary DNS server.
- The email address of the person responsible for that zone.
- The serial number used by secondary DNS servers to check if there have been changes to the zone.
If the zone information changes on the primary server, those updates are shared with other DNS servers. The serial number is updated to indicate that changes have been made.
- Refresh Interval (TTL)
This shows how often DNS servers should check for updates to the zone records. The TTL (Time to Live) determines this interval. You can adjust this number to increase or decrease the frequency of updates.
- Retry Interval
This is how often secondary DNS servers should retry checking for updates if the first refresh attempt fails.
- Expire Interval
This specifies how long the zone’s TTL remains valid after a refresh.
- Minimum TTL
The SOA record also specifies the default TTL value for the zone. You can refer to RFC 1035 for the full details on SOA records.
SRV (Service) Record
SRV records are used to link services with hostnames. For example, if an application is looking for a specific service, it will check for an SRV record containing the required information. The SRV record provides details such as:
- Hostname
- Ports
- Priority and Weight
- IP Addresses
Here are two examples of SRV records:
_sip._tcp.example.com. 3600 IN SRV 10 50 5060 serviceone.example.com.
_sip._tcp.example.com. 3600 IN SRV 10 30 5060 servicetwo.example.com.
In these records, _sip refers to the service name, and _tcp is the transport protocol. Both records have a priority of 10, with the first having a weight of 50 and the second a weight of 30. These values help determine which server should be used first. The last parts of the records specify the port (5060) and hostname (e.g., serviceone.example.com) for the service.
PTR (Pointer) Record
A PTR record (or reverse DNS record) does the opposite of an A record. It maps an IP address to a domain name. This record is primarily used for verification purposes to ensure that an IP address corresponds to a domain name. Not all DNS providers offer PTR records.
DNS Troubleshooting
Here are some common troubleshooting tips for DNS issues:
- If you see the message “Server IP address could not be found,” your A record might be missing. You’ll need to add an A record to your DNS zone.
- Check your DNS records for any misconfigurations.
- After changing nameservers, wait for them to propagate. This can take 24–48 hours.
- If the TTL (Time to Live) value is too high, propagation may take longer. For example, an A record with a TTL of 86400 seconds (24 hours) will take that long to propagate. It’s better to set a lower TTL (e.g., 300 seconds or 5 minutes) to speed up updates.
- If you’re using a third-party proxy server and your website isn’t showing up, you can check the issue by modifying your local host file. For instance, if your site is dnswebtest.com, you can add an entry to your host file that points the domain to your hosting provider’s IP address (e.g., 98.129.229.4). If the site loads correctly, the issue is likely with the proxy server.
Understanding DNS processes can help you troubleshoot more effectively. Below are useful tools for checking DNS propagation and records:
- https://www.whatsmydns.net/ for DNS propagation
- https://www.whoishostingthis.com/ to show what IP address a website is resolving to
How Can We Help?
We take pride in being The Most Helpful Humans In Hosting!
Our Support Team consists of skilled Linux technicians and expert system administrators with deep knowledge of various web hosting technologies, particularly those covered in this article.
If you have any questions or need clarification on any information, we are here to help, 24/7, all year round. We’re available to answer your queries and resolve issues related to this article at any time.
For customers using Fully Managed VPS, Cloud Dedicated, VMware Private Cloud, Private Parent servers, Managed Cloud Servers, or Dedicated servers, if you’re unsure about making any changes outlined here, feel free to contact us via chat or support ticket. We’ll be happy to guide you through the process.