Last updated 2004-06-28 by Roedy
Green ©1996-2004 Canadian Mind Products
Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
You are here : home : Java Glossary : D words : DNS.
String dottedQuad = InetAddress.getByName( "mindprod.com" ).getHostAddress();
String hostname = InetAddress.getAllByName( "199.93.4.15" ) .getHostName();
For a LAN, you can assign IP addresses such as 192.168.0.1, 192.168.0.2 to each station since these are never seen on the Internet. In Windows, you can use the utility ipconfig /all to display information such as DNS Server IP, host name, physical ethernet 48-bit MAC address, IP, subnet mask, gateway IP and DHCP server IP. In older versions of Windows there is a similar utility called winipconfig.
There is a master database of all DNS names and their corresponding IP names. It it not stored all in one computer, but to simplify the explanation, we will pretend that it is. Some DNS names have associated several IPs of server farms that are assigned on a round robin basis to share the workload.
www.mindprod.com, mail.mindprod.com and mindprod.com may all translate to different IPs or to the same IP. All three are tracked in the master database. Ordinary humans aren't allowed to talk to this master database. Instead you talk to a DNS server run by your local ISP. It does not have the entire database in it, just the entries most popular with the clients of your ISP. If you ask your ISP DNS server for a name it does not know, it asks a higher level server. If that higher level server does not know, it asks still a higher level server, working all the way back to the master DNS database server.
Does this mean you pester the master database every time you ask for a non-existent DNS name? Yes, but since the master database is actually entirely replicated in many computers, this is not the bottleneck you might expect.
How are changes propagated? Roughly once a day each DNS server asks the next higher level server if each of the entries it has cached in its local database is still valid. If not, it drops each invalid entry from its local database. If somebody later asks for that DNS name, the server will asks the next higher level server.
The master database server, through a tree of helpers, periodically asks every station on the net if its DNS name to IP translations are still valid, and if not, what the new information is. The information percolates up so that the master database is then completely up-to-date. From the master database, the information gradually percolates back down to all the ISP servers, through the ordinary process of asking the next higher level server when a server does not have a name in its cache. Information does not percolate down until it is needed. It generally takes about two days for out-of-date information to be totally flushed out of the system. How long it takes depends on a configurable freshness date for each name.
This way your computer only has to tell the Internet once about a DNS change. It does not have to directly tell every DNS server on the Internet.
What goes wrong is sometimes servers refuse to delete invalid cached entries. Then the only way to clear the out-of-date information is to reboot them and clear the entire cache. NT DNS servers have this problem. When a server fails to invalidate its cache, all downstream servers will be badly (i.e. weeks) out-of-date as well. The problem is not cleared until that server is rebooted.
DNS can do a number of other things besides convert a domain name to an IP number. It can go the other way, starting with an IP, figure out the DNS name. It can find out the latitutude and longitude of the server hosting the domain. It can find out what kind of CPU the server is. It can find out who owns the domain. It can distribute digital certificates. It can tell you the name of the associated mail servers. In Java you access this additional information with JNDI.
home |
Canadian Mind Products | |||
| mindprod.com IP:[24.87.56.253] | ||||
| Your IP:[80.134.30.163] | ||||
| You are visitor number 3188. | ||||
| Please send errors, omissions and suggestions | ||||
| to improve this page to Roedy Green. | ||||
| You can get a fresh copy of this page from: | or possibly from your local J: drive mirror: | |||
| http://mindprod.com/jgloss/dns.html | J:\mindprod\jgloss\dns.html | |||