Domain Name Service( 四 )


Type PTR A PTR query. This shows "inverse" or "reverse" resolution. Notice the very clumsy way the query has to be entered, this is partly because IP addresses have the most sigificant part first whereas DNS addresses have the most significant part last. There are plenty of pieces of software that do reverse resolution without this clumsy interface.
Program InterfaceThe commonest program interface to DNS uses the library functions gethostbyname() and gethostbyaddr(). These are discussed in more detail elsewhere.
Exploring a zoneThe nslookup program can be used to obtain a listing of all the hosts in a zone. To do this it is first necessary to identify the name server for the zone. This is done using an NS query, setting the server parameter to one or other of the identified name servers and then using nslookup s ls command. Note that in this example the user was careful to include the final dot on the domain name, this prevented nslookup from trying to append the local default domain name (scit.wlv.ac.uk.) to the required domain name. For large domains the ls command has an option to write its results to a file.
bash$ /usr/sbin/nslookupDefault Server:sunc.scit.wlv.ac.ukAddress:134.220.4.1> set q=NS> bilston.ac.uk.Server:sunc.scit.wlv.ac.ukAddress:134.220.4.1Non-authoritative answer:bilston.ac.uknameserver = unad1.wlv.ac.ukbilston.ac.uknameserver = ccua.wlv.ac.ukbilston.ac.uknameserver = ccub.wlv.ac.ukAuthoritative answers can be found from:unad1.wlv.ac.uk internet address = 134.220.192.26ccua.wlv.ac.ukinternet address = 134.220.1.39ccub.wlv.ac.ukinternet address = 134.220.1.20> server ccub.wlv.ac.ukDefault Server:ccub.wlv.ac.ukAddress:134.220.1.20> ls bilston.ac.uk.[ccub.wlv.ac.uk] bilston.ac.uk.server = ccub.wlv.ac.uk bilston.ac.uk.server = unad1.wlv.ac.uk bilston.ac.uk.server = ccua.wlv.ac.uk gw 194.62.148.1 novix1195.188.205.2 www194.62.148.4 fc 194.62.148.5 student1195.18.205.3The session above was logged in March 1998. It reveals 5 hosts in the bilston.ac.uk domain. Surprisingly three different class C IP network addresses appear in the output. This was because the organisation was in the process of changing its Internet Service Provider accounting for two of the network addresses, the third (195.18.205) is, apparently, a typographical error for 195.188.205. Furthre information on identifying the ownership of an IP network and, implicitly, a DNS domain can be found in the notes on IP routing.
Alternative DNS hierarchiesWith the rapid commercialisation of the Internet in the late 1990 s disputes over DNS names arose from time to time and suggestions have been made for the creation of extra top level domains. The root of the current DNS hierarchy is maintained by the Network Information Center on a contract from the government of the United States of America. There have been several attempts to set up alternative hierarchies. The most succesful (at the time of writing - April 1998) is probably Alternic. To use the Alternic DNS service you need to know the address of their root servers, one of these is mx.alternic.net. Here s an example showing that it does work for DNS resolution of www.alternic.nic. bash$ /usr/sbin/nslookupDefault Server:sunc.scit.wlv.ac.ukAddress:134.220.4.1> server mx.alternic.netDefault Server:mx.alternic.netAddress:206.191.128.47> www.alternic.nic.Server:mx.alternic.netAddress:206.191.128.47Name:www.alternic.nicAddress:206.191.128.47Alternic uses three letter top level domains for countries (such as jpn and ger) and has a large number of commercially oriented top level domains. At the time of writing the only domains with significant populations are porno and xxx.
A normal name server can only resolve Alternic addresses if they re already in its cache. Most DNS implementations with a list of root servers consult them in random order or consistently consult the first one in the list. Including one of the Alternic servers in amongst the list of root servers will not provide consistent resolution of addresses in both hierarchies. [Note: this particular aberration seems to have fizzled out (May 1999)]

推荐阅读