As you will no doubt be familiar with, if you want to browse a website, you need to enter its domain name in the browser. The browser then goes off and loads the website that you requested. If you specify a specific page name in the URL, the browser will make sure to request that particular page from the web server. It may be easy to assume that that is all the complexity involved, but there is more to it.
To route traffic to the right place, routers maintain a routing table. The routing table beeps a track of which physical connection the router should use for traffic depending on its destination. Managing these routing tables if they were using domain names, however, would be an arduous task.
With every website having a different domain name, the table size would be huge and searching it would be inefficient. Instead, routers use IP addresses to route traffic. As IP addresses are numerical and host multiple domains. The routing tables can be much shorter and more easily searched.
Unfortunately, IP addresses aren’t human-readable. At least, tthey’recertainly not memorable. While you may well remember Technipages.com, you’re much less like to recognize the IP address 126.96.36.199 and even less likely to remember the IPv6 address 2606:4700:20::681a:14a. To allow the use of memorable domain names for people and efficient IP addresses for computers. A translation mechanism needs to be used. That translation system is DNS.
What Is DNS
DNS stands for Domain Name System and is a protocol that translates domain names to IP addresses. The premise of the protocol is to make a DNS request to a DNS server. The request contains the domain name that you want to be translated. The request then goes to your device’s configured DNS server. If this server doesn’tknow the answer, it recursively forwards the request to the root DNS servers. At some point, one DNS server will have a cached entry. Or an entry for the authoritative DNS server for the requested domain.
Note: An authoritative DNS server is the server that has the data for the domain in question configured in a local file. All other DNS servers merely cache this answer and are not authoritative.
Once an authoritative or cached DNS result for the domain is found, that result is forwarded back down the chain, eventually to your device. Each DNS server in the chain then caches the result so that future requests can be resolved faster.
The actual data stored on the authoritative DNS server are DNS Zones. Only the DNS or Resource Record (RR) associated with the requested domain is returned.
Structure of a DNS Record
DNS records are written using DNS syntax. The format uses Name, TTL, Record class, Record type, and Record data. The TTL and Record classes may be stored as both formats are valid. A default TTL (Time To Live) can also be specified at the start of a Zone file that applies to any DNS record in the Zone without a TTL explicitly specified.
The Name field defines the URL to which the record applies. This can be “technipages.com.” “ww.technipages.com” .technipages.com” wildcard asterisks are supported. If the domain being specified is the same as the domain in the Zone, a “symbol can be used.
The TTL specifies how long a non-authoritative DNS server can cache the response. The longer this time, the less traffic the authoritative DNS server should see. However, it also means it takes longer for any updates to propagate.
The Record class is almost always “N” This defines an Internet record. There are, however, a small number of significantly less used networks in operation, such as Chaosnet, which would use the value “H.”
The Record type defines the type of DNS record being served. For example, IPv4 addresses are defined with Record type A, while email servers have the type MX. We cover some of the more common Record types in the next section.
The Record data contains the actual resolved value. This is typically another IP address but can also be another domain name. Again, generally, If another domain name is specified. That domain name is resolved to an IP address elsewhere in the Zone file. This isn’t always the case, though. Comments can be added to the Zone file behind a semi-colon “. These comments are not included in DNS responses.
Types of DNS Records
The most common Record type in DNS is the “record where “stands for address. “records always return IPv4 addresses. IPv6 addresses have the Record type “AAA” the four As reflect that IPv6 addresses at 128-bits long are four times as long as the 32-bit IPv4 addresses.
The “NAME” record type stands for Canonical NAME and is used to say “the requested domain has the same IP as this domain” CNAME records may point to A, AAAA, or other CNAME records. However, pointing a CNAME to another CNAME record is actively discouraged, as the recursive requests extend the request time for the user. Email servers use the “X” record type standing for Mail eXchange. The Record value for an MX record must include a priority number and a domain name. Similar to CNAME records, MX records must point to a domain name.
The “S” record type defines authoritative DNS servers for the requested domain. There may be more than one NS record, but they must always point to a domain. The SOA record defines the Start Of Authority. Every Zone file must include one; it explains administrative details, such as how long DNS servers should wait before checking if a value has changed.
How This Information Is Used
Hence DNS requests are hidden from the client. The vast majority of programs will quietly run DNS requests in the background to a point where the user could never know that the DNS protocol existed. Some tools allow you to monitor network traffic, letting you see the DNS traffic as it appears on the network. Other tools, like the “lookup” utility in Windows, allow you to make DNS requests. These tools typically format the output in a human-readable way, providing just the meaningful response, such as the IP address or addresses returned in the response.
A DNS record is a line in a DNS zone file on an authoritative DNS server. Each line includes a selection of values that define the type of record and its actual value. Non-authoritative DNS servers can cache these DNS records as they see them for the duration of the TTL. A user device makes a DNS request, waits for the response, then makes the HTTPS request, or other protocol depending on the software in use, to the defined IP address.