Domain Name System

From Unofficial BOINC Wiki

Jump to: navigation, search

Contents

[edit] General

First a little background; humans like names, computers like unique identifiers that follow strict rules, so computers use IP Addresses.

The problem with this is that humans don't like long strings of numbers (IP Addresses), they prefer a more memorable name, which is easier for them to deal with.


The Domain Name System is the answer to this problem.

The Domain Name System is comprised of many Domain Name Servers, each of which is responsible for performing a certain task within the Domain Name System.

The Domain Name System is the product of the combined services of all the Domain Name Servers around the world.

Most Domain Name Servers host the master authorative records for a particular DNS Domain (such as google.com)


A Domain Name Server provides the "mapping" from IP Addresses to, or from, a human-readable identifier (a DNS Domain Name). So, when you request a Web Page in your Web Browser, it will send a request to a Domain Name Server asking for the associated IP Address, the Domain Name Server will return an answer for the request, which is either the IP Address for the DNS Domain Name, or an error code (due to not being able to resolve the DNS Domain Name. It resolves the DNS Domain Name either by returning the data from it's own records, or by asking other Domain Name Servers for the requested DNS Domain Name. In most cases the Domain Name Server will return the appropriate IP Address for a DNS Domain Name, allowing the Web Browser to be able to connect to the site.

The Domain Name System as a whole, provides this service to computers around the world allowing users to enter DNS Domain Names instead of having to remember IP Addresses. This is also an advantage for Web Site Administrators, in that it allows the IP address of a server or Web Site to change, without users having to do anything differently, the changes will be propogated to other Domain Name Servers in the Domain Name System over the course of a day or two.


As mentioned before, most Domain Name Servers host the authorative records for a particular DNS Domain, however, some Domain Name Servers only provide the Caching element of the system. A Caching Domain Name Server is simply one that doesn't host any DNS Domains.

Caching is important because it allows things to work much faster than they would otherwise be able to, your ISPs' Domain Name Servers will be able to give you the IP address for this site directly from their own Cache rather than having to ask the Domain Name Server responsible for the ath.cx DNS Domain for the IP Address.

Caching is used so that not all requests need to cause Internet traffic. The ISP DNS server can look in it's own cache and say "hey, I just looked that up, and here's your answer!" rather than; "hummm... let me look it up.. I'll contact a root server which will tell me who really knows that domain, and then contact that server to see if it knows" for each request, which takes a lot longer; seconds rather than miliseconds.

All Domain Name Servers perform this caching by default, it is only disabled for specific reasons, because disabling caching has a negative effect on System Performance, and Response Time.

A Caching Domain Name Server is typically used to serve users when only a slow connection to the next Domain Name Server exists. Having this "local" Domain Name Server increases the speed at which names can be resolved, because it will keep answers to previous queries in it's own database, so that it can provide those same answers faster to future requests from other computers. Otherwise all the computers would have to resolve DNS Domain Names by asking the Domain Name Server located on the other side of the slow connection, which means that it would take longer to resolve a DNS Domain Name.

[edit] A Typical Example

For this example I'll explain how DNS Domain Name resolution occours on my own network, so that I can use specific server names so that the process is clearer and easier to follow & understand. This process applies to any application which needs to resolve DNS Domain Names to IP Addresses, not just Web Browsers.


I open a Web Browser (for me this would be Firefox), and I enter http://www.google.co.uk/ into the address/location bar.

Now that the Web Browser knows what i want, it can start the process of retrieving the Google home page.

To be able to connect to the Google Web Server, the Web Browser first has to resolve the www.google.co.uk DNS Domain Name to a format that the computer can use and understand; an IP Address.

The Web Browser does this by checking the network configuration of the computer it's running on (it will be different for various computers) for the IP Address of the Domain Name Server it should contact, in my case i run my own Domain Name Server, which also hosts my own internal DNS Domain, the name of my Domain Name Server is ns1.carre.local [1].

Once this information has been retrieved it sends a query for the requested DNS Domain Name, in this case www.google.co.uk, to the Domain Name Server it found in the network configuration, in this case ns1.carre.local.

If ns1.carre.local knows the answer it will return the IP Address of www.google.co.uk to the requesting computer without contacting any other Domain Name Servers, if it doesn't know the name, it will ask a more authorative server (the next one up the hierachy), the actual server it asks will depend on the DNS servers' configuration, in this case my DNS server (ns1.carre.local) is configured to ask the Domain Name Server of my ISP; ns1.jtibs.net, if it knows the answer for the requested DNS Domain Name. (Because my ISPs' DNS server is used by lots of other people (all the other customers of my ISP, so is likely to know many answers, and be able to return them quickly considering it's relatively close, on the network, to my own server)

The ns1.jtibs.net Domain Name Server will check it's own records to see if it already has the IP Address for www.google.co.uk, if it does it will reply to my ns1.carre.local DNS server with the answer, then ns1.carre.local will send the answer to my computer. If the ns1.jtibs.net DNS server doesn't know the answer, it will ask a more authorative DNS server, again depending on it's configuration.


Now, to see what happens in a full query, lets assume that neither my DNS server (ns1.carre.local) nor my ISPs' DNS server (ns1.jtibs.net) know the IP Address for www.google.co.uk, what will eventually happen is a DNS server will ask one of the DNS root servers for the authorative servers for the uk DNS Domain, once it has this information, it will ask the uk DNS servers for the authorative servers for co.uk DNS Domain, then for the google.co.uk DNS Domain, and finally the www.google.co.uk DNS Domain Name. The answer for this query will be relayed back along the chain, to ns1.jtibs.net, which relays the answer to ns1.carre.local, and finally to my own PC.

Once my computer has the IP Address it will pass it up to the Web Browser which is then able to initate a connection to that IP Address to request the Google UK home page (http://www.google.co.uk/).


[1] You may remember that earlier I mentioned one of the advantages of the Domain Name System is that it allows IP Addresses to change, considering that; the reason the network configuration of computers only specifies an IP Address rather than a DNS Domain Name is because the computer would need to be able to contact a Domain Name Server in order to resolve the DNS Domain Name of the server specified in the network configuration, thus if a DNS Domain Name were used, we would end up with a paradox, where (A) the computer running the Web Browser needs to contact a Domain Name Server in order to resolve the DNS Domain Name of the Domain Name Server in the network configuration that it should contact, but to do that it needs to (B) resolve the DNS Domain Name of the Domain Name Server in the network configuration, which requires (A) contacting a Domain Name Server to be able to resolve the DNS Domain Name, and onwards without ever being solved... hence why only an IP Address is specified, so that the computer can contact the Domain Name Server directly, enabling it to resolve Domain Names.

[edit] Why DNS Changes Do No Not Occur Immediately

In short this is due to the fact that Domain Name Servers Cache the answers they recieve from previous queries, but remember Caching is a good thing, it helps performance.

DNS records have various Time To Live (TTL) values associated with them, these TTL values indicate now long a record may be cached by another DNS server before the record expires and how long the record may be used before it must be checked for changes.

TTL values are set on the authorative DNS servers for a DNS Domain. Because records don't change that often, many records have quite long TTL values, 24 hours is a typical value.

So other servers can cache those records for upto 24 hours, before the records must be checked for changes.

The core reason for records not being globally updated immediately is because of TTL values. It's also worsened by the fact that the TTL count-down is started from the time the caching DNS server recieves the record, so you can imagine a situation with a certain unfortunete timing, that a chain of DNS servers aquires a DNS record at different times, and the last DNS server in the chain may be the last to recieve the record, so, in this case, it would be 24 hours before that server checks the record again, this is again worsened if the record on the authorative servers is changed just after other DNS servers cache the record.

So a change takes time to propogate throughout the Domain Name System, allowing the time for records cached on other DNS servers to expire, and the records in quesion be cehcked for freshness.


Resetting your network will not help, unless you are running your own DNS server. Many domestic NAT routers have their own DNS server.

While the "lookup" is cached by your ISP, resetting any local machines won't really help. It's like looking in the same copy of the phone book for a new phone number. That number won't change until the phone book is replaced. With the name server cache, that replacement will only happen somewhere between a few hours to a few days.

Now, before you ask "why not just set short TTL values for records?", yes, you could do that, but that defeats the whole purpose, DNS records aren't changed that often anyway, and by having a short TTL value you cause more traffic to be sent to your Domain Name Server (this can be a huge problem, and result in high costs for popular DNS Domains such as google.com, which recieve lots of DNS queries anyway, with their exiting TTL values, nevermind reducing it further for the odd times that they do change an IP Address.

The effectiveness of Caching of DNS records to be reduced for your DNS Domain, and in the world of speed, those extra few seconds to resolve a name, to be able to display your site matter quite a lot.

Also many sites leave the Service running at the old IP Addresss untill the changes to the DNS records have propgated to most of the Domain Name System, so you don't notice the change anyway.

That's why Technical News items talk about this kind of time frame for DNS changes. This is common with name service.

I have a local name server (ns1.carre.local) and I could configure it to not ask the DNS server of my Internet Service Provider (ns1.jtibs.net), and configure it to ask the root servers directly so I could flush the cache of my DNS server, and be back talking to the Scheduler, using the new IP Address, in a matter of minutes. However, i choose not to configure my DNS server this way, because it's quite inefficient to keep asking the root servers all the time, when the DNS servers of my ISP can provide many of the answers far quicker (the request has to go through fewer routers, which saves time, and their DNS server has many records cached due to other customers using it, so it's benificial to everyone to use a hierachy).

Some ISP's, if you ask them, *might* be willing to flush their DNS cache, but most I've dealt with in the last 5 years either don't understand the request, or say "just wait.. It will correct itself in a day or two". (that's why I do my own name service!). This isn't really practical for ISPs due to the amount of DNS traffic they handle, if their DNS servers suddenly don't have any answers cached, and have to ask the root servers for every query it can cause mayhem, and is one of the reasons most ISPs won't flush their cache (I sure wouldn't unless there was a problem).

Like i said, records don't change often, and even when they do, provisions are put in place to make the transition as smooth as possible (like running the service at the old IP Address for a while, while the DNS changes propogate throughout the DNS System.

[edit] Synonyms

  • DNS System

[edit] Also See

Personal tools