This reference guide outlines what DNS is, how it functions on the Internet, and common uses within web hosting.
Importance of DNS
The Domain Name System (DNS) is used to resolve human-readable hostnames (IE. inmotionhosting.com) into machine-readable IP addresses (192.145.237.216). DNS also provides other information about domain names, such as mail services.
DNS is like a phone book for the Internet. If you know a person’s name but don’t know their telephone number, you can simply look it up in a phone book. DNS provides this same service to the Internet. Without DNS, you would only be able to visit our website (or any website) by visiting its IP address directly.
Common DNS Record Types
There are several different types of DNS records that are useful for directing website and email connections. These are the ones most commonly used in web hosting.
- Nameserver (NS) record
- This record is used to indicate which DNS server is authoritative for a domain (simply put, the nameserver contains the actual DNS records stored in a zone file)
- A Record
- This is the primary record for a domain and simply means Address Record
- It is responsible for directing any connection to the server that is in charge of handling said connection
- It is important to know that an A record always points to an IP address
EXAMPLE: The provided information is in reference to the domain imhkm.com and this domain is pointing to the A Record, IP 70.39.248.213. In 252 seconds, the network router will need to refresh the provided data.
- CNAME Record
- This record points one domain to another domain or hostname rather than an IP Address
- The most common CNAME record is www.
EXAMPLE: The subdomain www.imhkm.com is pointing to the domain imhkm.com. The domain imhkm.com is pointing to the IP Address 70.39.248.213. This "daisy chain" is of practical use. If both records needed to point elsewhere, this could be achieved by modifying one A Record instead of needing to adjust multiple records.
- MX Record
- This record is used to direct email for a domain
- Most systems, ours included, make it a requirement that MX records point to a domain name or hostname, not an IP address
EXAMPLE: Reviewing the above, we can see that any mail for imhkm.com will be directed to the domain mail.imhkm.com. There is additional information shown, however. Along with the time to live, IN, and record type, MX records also include a priority. Here the priority is set to ten. The priority plays a larger part in the sending of mail when there are several MX records attached to a domain registration. Based on the priority number, the email will be sent in a specific order; the lower the number, the higher priority. This is a measurement taken often to ensure redundancy where if a server is not working, the mail can still be sent via a different server.
TIP: To illustrate this, if there are three MX records with the priorities 10, 1, and 50, mail will first be sent to the MX record with the priority of 1. If this fails, the mail will attempt to send through the MX record with the 10 priority, followed by the 50 priority. If however any MX record is set with the priority of 0, it will never attempt to send mail through any other mail server. Thus, even if there are 2 or more MX records created, if any MX record is set to zero priority, it will act as if there is only one MX record.
- TXT Record
- This record is used to connect a string of data or text to a domain, mainly for verification purposes of domain ownership or email authentication
- The most common type of TXT record is an SPF record which is used for controlling spam
EXAMPLE: The TXT record illustrated above is an example of an SPF record. When mail is received from the imhkm.com domain, the receiving server is going to check for the associated IP Address and includes. If the mail is coming from a server with the IP address 198.46.81.44 or an IP included in smtp.servconfig.com, it is most likely clear. If the mail is coming from a server that is not the indicated IP address, there will be a suspicion that the mail is spam.
How DNS Works
- Step 1: The Initial Request
- The first step in any request is that it looks at your local machine's DNS cache, which stores recently retried DNS requests
- If the cache doesn't contain the information needed, the query is made
- Step 2: Request from the Recursive DNS servers
- After checking locally, your machine will contact your internet service provider's (ISP's) recursive name servers
- These DNS servers will take the request made and then do all the work from there
- These servers also carry a cache as well and if the record is found there, it will relay that information over to your machine
- Step 3: Request from Root Name servers
- If the recursive name servers don't have that info in their cache, it proceeds to ask the root name servers
- A name server is a computer that answers questions about domain names, such as IP addresses
- There are thirteen root name servers that act as a kind of telephone switchboard for DNS
- They don’t know the answer, but they can direct our query to someone that knows where to find it
- Step 4: Request from TLD Name servers
- The root name servers will read any query given to it from right to left
- For example, looking at www.inmotionhosting.com, it will read the .com first and direct the request to the Top-Level Domain (TLD) name servers that handle .com
- Each TLD (.com, .org, .us, etc.) has its own set of name servers that direct us to the appropriate DNS server to retrieve the DNS information
- Step 5: Request from Authoritative Name servers
- The TLD name server will query out to the authoritative name servers with the first and second parts of the DNS request (www.inmotionhosting.com)
- These authoritative name servers are responsible for knowing all the information about a specific domain, which is stored in DNS records
- There are many types of records, which each contain a different kind of information
- Step 6: A Record
- The recursive server retrieves the A record for inmotionhosting.com from the authoritative name servers and stores the record in its local cache
- If anyone else requests the host record for inmotionhosting.com, the recursive servers will already have the answer and will not need to go through the lookup process again
- All records have a time-to-live value, which is like an expiration date
- After the time-to-live expires, the recursive server will need to ask for a new copy of the record to make sure the information doesn’t become out-of-date
- Step 7: Answer
- Armed with the answer, the recursive server returns the A record back to your computer
- Your computer stores the record in its cache, reads the IP address from the record, then passes this information to your browser
- The browser then opens a connection to the web server and receives the website
TIP: Anytime a domain name is typed into a web browser, the steps outlined below are performed. Any time a new page is visited, a new email is sent, etc., and it takes place in a matter of milliseconds.
VISUAL EXAMPLE:
Comments
0 comments
Article is closed for comments.