Beruflich Dokumente
Kultur Dokumente
What Is DNS?
DNS is the domain name system. It translates human-friendly website addresses like www.cnn.com into computer-friendly IP addresses like 157.166.224.25. Try visiting http://157.166.224.25 if youd like to verify this. Every computer, Web server and networking device on the Internet has one of these numerical IP addresses. In some cases, through a process called network address translation, a whole house, office or building shares the same IP address. But the addresses are otherwise unique, and they allow computers to easily route information around the Internet. DNS is a distributed service. No single computer out there translates domain names to addresses. Instead, the task is shared by millions of name servers (also spelt as one word, nameserver), which constantly refer to and update each other.
53CLM1118337
local name server to go off and find the corresponding IP address, 80.72.139.101 in this case. Your computers name server cant make this translation by itself; it has to keep asking other name servers until something somewhere comes back with a definitive answer. Your local name server is like the little address book that you kept near the telephone before mobiles were invented. If you hired A1 Triple Glazing to retrofit your windows, you might have copied their phone number into your address book. The next time you had to ring them, the number would be right there, immediately available. Or under the sofa.
53CLM1118337
123-reg is a domain name registrar that does hosting on the side. A company from which you buy and register a domain name is called a registrar. Registrars get a special license from ICANN that allows them to sell domain names. The license costs $2500 (US) to apply, plus $4000 per year. Some particularly large registrars are GoDaddy in the US and 123-reg in the UK. After registering a new domain name, there may be a delay of a few minutes to a few hours before you can log into the registrars website to change the domains name servers (step 3 below) or point to an IP address (step 4 below). This delay is a result of the registrar processing your payment, adding you to the Whois database and updating its records. The delay applies only to brand new domains and so is not part of the DNS delay.
53CLM1118337
Some companies provide only hosting. The hosting company puts your website on a big powerful server somewhere, provides you with an IP address and charges you monthly. Thousands of big and small companies offer hosting or resell another companys. Most registrars also offer hosting, and if you buy the domain name and hosting space from the same company, you wont need to worry at all about DNS.
53CLM1118337
Almost all registrars allow you to change name servers. This screenshot is from Fasthosts. This step is akin to specifying which Yellow Pages your domain name should appear in. Usually you can skip this step and just use the default name servers provide by the registrar. You might want to change them if, for example, you registered the domain names (step 1 above) with several companies but wanted to manage the DNS (step 4 below) from one place. Or perhaps you used Really Cheap Registrar Plc to register the domain names, but you want to use Really Flexible DNS Plc to manage the DNS. Or perhaps your host (step 2) has a nice DNS interface that youd like to use. To change the name servers, log into your registrar (from step 1 above), navigate to the domain name in question, and look for a Change name servers option, as in the screenshot above. Really Flexible DNS Plc will tell you what to change them to.
53CLM1118337
Using Fasthosts advanced DNS to add the IP address of a website. Now you need to log into whichever company is providing the name servers (either the registrar, the host or another) and point www.yournewdomainname.com to your new IP address. Usually there is an option for DNS Settings or Advanced DNS, often with a big warning asking whether youre sure you know what youre doing. Find the button to add an new A record (for Address). Enter www as the host name (i.e. the prefix for the domain name) and the IP address given by your host in step 2. You can use the same process to create other address records, such as webmail.yournewdomainname.com. Sometimes you can enter * as the host name, and then everything.yournewdomainname.com will point to the IP address. And if you enter @ as the host name, then it will point yournewdomainname.com without any host name.
53CLM1118337
changes will go global just as soon as they catch up. The next section discusses how DNS works in detail, and the final section covers the main part of the DNS delay.
53CLM1118337
What the command looks like in Linux. In this case, my computer sends a request to 192.168.1.1, something along the lines of, Oi, 192.168.1.1! Whats the IP address for www.smashingmagazine.com?
This will return the names and IP addresses of a handful of root name servers. If youd like to see whats holding the Internet together, Wikipedia has a picture of one of these very important computers.
53CLM1118337
53CLM1118337
10
53CLM1118337
something like, Hi, 192.52.178.30. Do you know where I should go for stuff on smashingmagazine.com? You can see the answer to this question by running NsLookup again:
nslookup -type=ns smashingmagazine.com 192.52.178.30
This returns a list of name servers for the domain smashingmagazine.com. The word authoritative means that these name servers are the definitive place to go for DNS information on smashingmagazine.com.
11
53CLM1118337
Bingo! Now your local name server knows that www.smashingmagazine.com translates into 80.72.139.101
Windows users will need to use an online version of this tool, because Windows does not come with the dig command.
12
53CLM1118337
Digging Smashing Magazine. In the Answer Section, is a line starting with www.smashingmagazine.com (the thing you asked about) and ending with the translated IP address. The number in the middle is the number of seconds before your local name server forgets about this domain and has to repeat steps four and five above. In this example, it is 238 seconds:
;; ANSWER SECTION: www.smashingmagazine.com. 238 IN A 80.72.139.101
This caching on your local name server is responsible for part of the DNS delay. In this case, even if Smashing Magazine changed its IP address right now, your computer wouldnt know about it for at least 238 seconds, when the local name server would have to recheck its sources. If you use the online tool, then you are not checking your personal local name server, but rather youre checking that websites local name server. You can run a slimmer version of this command:
13
53CLM1118337
Also note that in all of the commands above, you could have provided the name of the name server rather than the IP address. NsLookup would have translated it for you.
Time To Live
The caching in step six above is the main cause of the DNS delay. Any given translation (of a Web address into an IP address) has a property called time to live or TTL. This tells domain name servers how long they are allowed to cache the translation before having to look it up again. You can find out what the TTL for a given (fully qualified) domain name is using
14
53CLM1118337
the dig command, instructing the command to use the domain names name server, like so:
dig @a.regfish-ns.net www.smashingmagazine.com
Finding out the time to live, which in this case is 1800 seconds, or half an hour. The Answer Section shows that www.smashingmagazine.com has a TTL of 1800 seconds:
;; ANSWER SECTION:
15
53CLM1118337
www.smashingmagazine.com. 1800
IN
80.72.139.101
That is, your local domain name server will remember this for 1800 seconds. If Smashing Magazine suddenly decided to change its IP address, your local domain name server could hang onto the old IP address for up to 30 minutes. The command also specifies how long to remember that a.regfish-ns.net is a name server for smashingmagazine.com:
;; AUTHORITY SECTION: smashingmagazine.com. 86400 IN NS a.regfish-ns.net.
If Smashing Magazine suddenly decides to change its name servers, your local domain name server would hang onto the old name server for up to 86,400 seconds, which is one whole day. Only then would it ask for the new name server, and only then would it ask the new name server for the new translation.
Moving A Website
And now for the grand finale! This section ties together all of the above to explain the delay. Three sections ago, we had an in-depth description of how to buy a domain name and set up the DNS. This section looks at what happens when you change the IP address of an existing address.
The name servers for this domain are listed as ns.rackspace.com and ns2.rackspace.com.
16
53CLM1118337
Changing the IP address for an existing address record at Rackspace. To actually make the change, you will need to log into the website of the company that manages your name servers, as in the section far above. Then find the (fully qualified) domain name that you want to move, and click on something like Edit DNS Settings or Advanced DNS. Then find the address record you want to change, and edit and save it.
Keep running this command until it comes back with the new IP address. This particular change with Rackspace took 10 to 20 minutes. This is the first part of the DNS delay, and it could take anywhere from 0 to 24 hours.
17
53CLM1118337
Look in the Answer Section. It will give you the IP address that it thinks is correct (ending in 33 in this case), and the number of seconds until this expires (91).
;; ANSWER SECTION: test.stockashop.co.uk. 91 IN A 92.52.106.33
After the 91 seconds have passed (which felt a lot longer than 91 seconds as I was actually doing it), the answer will suddenly change. The IP address will be the new one (ending in 34), and the number of seconds will reset back to about the time to live (1799 in this case, or 30 minutes).
;; ANSWER SECTION: test.stockashop.co.uk. 1799 IN A 92.52.106.34
Now you can restart your browser (to clear its internal cache) and visit the address. Your browser should go to the new IP address and the moved website. You can also use an online dig to test this, although you will be using its name servers instead of your own; so even if it returns the correct IP address, you (or your client) may have to wait a bit longer. Most DNS entries have a time to live of 86,400 seconds, which is 24 hours. This will add another 0 to 24 hours of delay, with an average of 12 hours. So, the total delay could be between 0 and 48 hours. Note that the process is similar when changing the name servers for a domain. You can use nslookup or dig to keep track of the changes.
18
53CLM1118337
There are a few techniques for shrinking the delay, or eliminating it entirely. Please comment if you have any other suggestions.
Email
If you have to transfer email accounts along with the website, the easiest way to do this is to set up the email addresses on the new mail server (i.e. the server that stores the emails, which is usually the same as the Web server), and then
19
53CLM1118337
change the DNS MX record (which specifies which server handles the email for the domain) on a Friday afternoon. By Monday morning, everyone will know about the change, and you can download all of your email one last time from the old mail server, change your email preferences to reflect the new mail server (and your passwords, if they have changed), and then start checking your email on the new server. This only applies to POP accounts on which no mail is left on the server. IMAP accounts are more difficult; youll have to copy all of your emails off the old server first, and then reupload them to the new server. There are other more immediate methods as well, such as changing the TTL or specifying MX records for both the old and new mail servers at the same time.
Conclusion
The 24 to 48-hour DNS delay is caused by two main factors: 1. The time it takes your registrar or host (or other company) to process your DNS request, which could be anywhere from a few minutes to 24 hours. Before this happens, nobody anywhere has any chance whatsoever of knowing about the change. 2. The time it takes for your personal name server to learn about the change, which can vary from instantly to the time to live (usually 24 hours). The delay from this will be different for everyone. Hopefully this article has given you a solid understanding of the basics. Please feel free to comment if you have anything to add or suggest. (al) (il)
20