Understanding Domain Name Service (DNS)
In this article, we cover the basic concepts involved in Domain Name Services (DNS) and domain registration, so that you can understand how they are involved in email and web hosting services. You may also be interested in reading our separate article where we interview Mark Jeftovic at easyDNS.
A DNS Example
To understand what Domain Name Service (DNS) is and how it is used, it is best to start with an example: John Sample wishes to register and setup a domain for web site and email services. Here are the steps involved:
1. Registration of the Domain: John goes to some company, such as LuxSci, and finds a domain name that he likes and which isn’t taken by someone else. He then registers it, paying a fee for one or more years. What does this registration actually buy him? It depends on the company he registered at and for what exactly he signed up; however, it usually only means that John has now leased the domain name for some period of time. He doesn’t actually “own” it, he just has the sole right to use it for some period of time, after which he has the right to renew his lease.
Note that when you register a new domain name [say at LuxSci], it will take up to 24 hours for that domain to become live and functional on the Internet. If you register it elsewhere, it may take longer.
If you are thinking about using a service that provides “private domain registrations”, please see the Dangers of Private Domain Registrations and WHOIS Masking.
2. Sign up for web and/or email hosting: John then contacts some company, such as LuxSci, to order hosting. A hosting company provides the computers on which John’s web site files will reside and/or which will accept email for John at this new domain name.
What is missing? DNS. Registration of the domain gave John a “name” on the Internet; obtaining web or email hosting services gives him an “address” — the Internet addresses of the computers owned by the hosting compan(ies) that will be handling John’s web and email needs. What is missing is a connection between the name and the addresses.
We like to make the analogy that DNS is like a “phone book” for domain names. It contains entries that indicate which computer (Internet Protocol – IP) address corresponds to which domain name (and vice versa). You probably use DNS all the time and don’t even know it! Whenever you type an address such as “http://google.com” into your web browser, the web browser uses DNS to find out the numerical address(es) of the computers that handle Google’s web site; it then uses these addresses to connect to those computers to get the web site files.
Thus, anyone who has a domain name that is to be used for email or web services needs DNS services as well. These services are usually provided by your web or email hosting company, because they know their computer addresses and should be in a position to update your DNS settings for you if any of their computer’s addresses needs to be changed.
You may be able to manage your DNS settings yourself if, for example, your domain registration company provides this service to you, or if you use a company like easyDNS (of which LuxSci is a partner and whose services LuxSci offers at a discount to its members).
3. Transfer your domain. If your web hosting company is going to take care of your DNS settings for you, you need to give them control over these settings. This means telling your domain registrar (Register.com in this example) what servers your web hosting company is going to be using for your DNS…. your web hosting company will tell you what to say.
DNS Summary
Now, you should have a rough picture of the complexity involved in managing a domain name — there are at least 3 sets of computers involved!
- One set belongs to your domain name registrar. They keep track of what domains are registered, who owns them, and what computers manage the DNS settings for each of these domains. (This information is stored in a big database called the “whois” database).
- One set belongs to the company that manages the DNS settings for your domain. These computers understand what computer addresses correspond to what domain names. Other computers, like your web browser, can ask them to look up the name for an address, or vice versa.
- The third set belongs to your web and email hosting company. On these computers, your web site files are stored and your email is delivered. These are almost always different computers than the ones that handle the DNS lookups.
Mail Exchange (MX) Records
An “MX Record” is a DNS entry that indicates what server(s) handle the email messages for your domain. These can be, and usually are, different servers than those that handle your web site. “MX” stands for “Mail Exchange”. Typically, you will have 2 or more MX records for your domain. One is primary; the others are secondary and will provide load balancing or failover for increased delivery reliability.
Subdomains
If John Sample registered “sample.com”, then he really can have any number of domain names, as long as they each end in “.sample.com”. I.e. “john.sample.com”, “x1234.sample.com”, and “www.xqy.apple.sample.com” are all domains that John has a right to setup and use because he has registered “sample.com”. These are all called “subdomains” because you cannot register them individually, but get them if you register the normal domain “sample.com”. Subdomains are created when entries for them are made in the DNS settings for your domain.
You can configure your DNS settings to use any addresses you wish for web and email for any of your subdomains. Your DNS provider should allow you to do this as a matter of course. However, your web or email hosting provider may charge you extra for the use of additional web sites (for each subdomain) or additional email domains.
If your subdomain is configured to point to another domain name or subdomain name, rather than to a computer’s address, it is known as an “alias” or a “CNAME”. When a domain or subdomain points directly to a computer’s numberical “IP Address”, this is known as an “A record” (Address Record).
DNS Propagation: Time-To-Live (TTL)
The “Time-To-Live” or TTL is an important DNS setting that you should be aware of when you want to change your DNS settings or the company that manages your DNS. A TTL is roughly the time that it can take for any change in your DNS settings to take effect all throughout the Internet. A small setting such as 20 minutes will cause all your settings to propagate across the Internet in about 20 minutes or so, a large setting can result in the changes taking days to be noticed. A typical default setting can be 6 to 24 hours! Clients for whom LuxSci manages their DNS generally have their TTLs set to 3 hours, unless they request otherwise. Note that the TTL is also the time it will take for changes in the TTL to take place…!
Why are your changes not instantly available? The answer reflects the clever way in which DNS works. Your changes ARE available instantly on the actual computers that manage your DNS. In order to prevent everyone in the world from asking your DNS servers directly for your DNS information, which would bog them down greatly, DNS is set up so that people’s computers ask local DNS servers at their ISPs. These return the information if available, otherwise, they ask other “upstream” servers until evertually some server asks your main “authoritative” ones. All of these intermediate servers keep the information so that they can give it out again quickly without asking the “upstream” servers again. This information is all remember as long as your TTL is (without going into the fine details). For this reason, its takes a time equal to the TTL before all of these servers refresh their information. It also means that some people will see your new settings sooner than other people…. all based on when their upstream DNS servers need to refresh their saved information.
This distributed method of looking up DNS information is good because it is fast and minimizes the work your DNS servers have to do. It has the drawback that the other DNS severs have stale information whenever you change the data on your servers. To compensate, you can set your TTL to be small. Effectively, if a DNS server has information that is older than the TTL, the DNS server doesn’t trust that the data is accurate and goes to get a fresh copy. This is why the time it can take your DNS changes to propagate across the Internet is approximately the TTL settings you have made for your domain.
Why not always use a very small TTL?
There are two main reasons for that:
- The smaller your TTL, the slower your email or web site will be … as computers and servers will have to be spending more time refreshing DNS information.
- The TTL setting is “advisory” in that DNS servers do not have to obey it … they CAN cache your DNS information for longer than the TTL. This usually is not an issue unless you try to make your TTL very small … then some DNS servers may ignore your TTL and use their default minimum settings for TTLs.

May 13th, 2009 at 8:16 pm
[...] Domain name services control the publication of which servers at what providers are in charge of your web site, your email, and other services. Any domain that is being used (as opposed to merely being “parked” for possible later use) needs DNS services to function. Please refer to Understanding Domain Name Service (DNS). [...]
May 24th, 2009 at 11:59 am
that was helpfull for me thanks…..
May 30th, 2009 at 4:37 am
Excellent article! Been scouring the web looking for something like this for a while.
July 22nd, 2009 at 1:14 pm
[...] domain (these are the “mail exchange” or MX records for the domain; see also Understanding Domain Name Service (DNS)) includes an ordered list of SMTP Servers that expect to receive email for this recipient. The [...]
November 6th, 2009 at 10:14 pm
[...] and Postini work by having your email delivered to their filtering servers first (because your DNS MX records point there). Once filtered, their servers will deliver the messages to your email servers for [...]
January 10th, 2010 at 9:14 pm
[...] has recently lowered its prices for DNS services [and domain registrations]. We are now cost competitive with all major DNS services offered, with [...]
May 4th, 2011 at 3:18 pm
[...] DNS or network issues prevent the server from being able to determine what server is supposed to be next. [...]