🕒 Reading Time: 3 minutes
While the Domain Name System (DNS) is generally familiar to most web users as the source of human readable network addresses, the actual configuration of DNS records may feel more esoteric.
To start, lets go over what DNS is, and how it works in a nutshell. The domain name system allows network locations to be identified by addresses that are much easier for a human to read. Thus you can go to www.cari.net
instead of 18.104.22.168
. The system also allows a site to decouple its identity from its IP address
; thus a site can move to a different datacenter or geographic location, receive a new IP address
, but keep the same familiar domain name.
DNS is sorted out by a number of systems across the Internet. Every domain has a registered “authoritative server”. This name server acts as the end-all authority for the records of a particular domain. This server can be queried by any location to get the DNS records, but in practice it is primarily queried by “caching name servers”. These DNS servers act as intermediaries to reduce load on authoritative servers and increase performance for users. Instead of asking an authoritative server for information, a computer might ask its caching server. The caching server can reply immediately if it knows the answer, or ask the authoritative if it does not. Any time a caching server must ask an authoritative server for information, it will cache that information.
While the caching system does increase performance, sometimes significantly, it is also the primary reason that DNS changes can take unpredictable time spans to take effect. Different caches will renew their information at different times, meaning some users may see the old information and some may see the new information for a period, generally between 4 and 48 hours.
Of course all this talk about records merits some discussion of the types of records and how they work? The first is known as the A record. It is very important, as it is generally the source of your primary IP address
for a site. In the zone for mysite.com, the following A record will point web users looking for www.mysite.com to 192.168.0.100:
www A 192.168.0.100
You will notice that I mentioned a zone, and that mysite.come is not listed in that record. If the zone is for mysite.com, every record will add a new subdomain to mysite.com.
Similar to the A record is the CNAME. The CNAME points a subdomain to a domain name instead of an IP address. If the domain is in the same zone, only the subdomain is needed, as in this example were web.mysite.com is directred to www.mysite.com:
web CNAME www
You can also use a CNAME to point to a totally different domain, such as this example:
web CNAME www.othersite.com.
One more very important record for many users is the MX record. These keep track of the mail receiving servers for a domain. They work like CNAME records in some ways, so it is common to have a corresponding A record, as in this example:
mail A 192.168.0.200
@ MX 10 mail.mysite.com
This record sets an MX record pointing to whatever server is at mail.mysite.com (192.168.0.200). The extra number in this record is priority. In this case, priority of 10 is ignored, but if there was another MX record with a lower priority number it would be tried before the one in the example.
The last record to be concerned with is an NS record. This defines a name server. In most cases, these will be the server the DNS zone is hosted on, although in some situations they have advanced uses. They look like this:
ns1 A 192.168.0.10
@ NS ns1.mysite.com
You will notice a strong similarity to MX records here. Again, these are a little bit advanced. If you think you see something wrong with an NS record, you should contact your DNS provider. At CARI.net, NS records are set to a reasonable value by default when a new DNS zone is created.
A proper understanding of the DNS system can help with preparing new sites for business and with tricky migrations. Of course, if you are a CARI.net
customer and need more information about DNS or help configuring your records, contact support at 858-974-5080 x 200 for assistance.