📄 faq
字号:
but would not be exported to other nameservers. In the newer Sun one, theyare left in the cache and are mostly ignored once named is up and running.This isn't a bad solution, its just not a good one.Decel is the main machine in our domain. It has the IP number 130.95.4.2and that is what this next line shows. It also has a HINFO entry. HINFOis Host Info which is meant to be some sort of an indication of what themachine is and what it runs. The values are two white space seperatedvalues. First being the hardware and second being the software. HINFO isnot compulsory, its just nice to have sometimes. We also have some MXrecords so that mail destined for decel has some other avenues before itbounces back to the sender if undeliverable.It is a good idea to give all machines capable of handling mail an MXrecord because this can be cached on remote machines and will help toreduce the load on the network.gopher.ecel.uwa.edu.au is the gopher server in our division. Now becausewe are cheapskates and don't want to go and splurge on a seperate machinejust for handling gopher requests we have made it a CNAME to our mainmachine. While it may seem pointless it does have one main advantage.When we discover that our placing terrabytes of popular quicktime movieson our gopher server (no we haven't and we don't intend to) causes anunbearable load on our main machine, we can quickly move the CNAME topoint at a new machine by changing the name mentioned in the CNAME. Thenthe slime of the world can continue to get their essential movies with aminimal interuption to the network. Other good CNAMEs to maintain arethings like ftp, mailhost, netfind, archie, whois, and even dns (though themost obvious use for this fails). It also makes it easier for people tofind these services in your domain.We should probably start using WKS records for things like gopher and whoisrather than making DNS names for them. The tools are not in widecirculation for this to work though. (Plus all those comments in many DNSimplementation of "Not implemented" next to the WKS record)Finally we have a macintosh which belongs to my boss. All it needs is anIP number, and we have included the HINFO so that you can see that it is infact a macII running a Mac System. To get the list of preferred values,you should get a copy of RFC 1340. It lists lots of useful informationsuch as /etc/services values, ethernet manufacturer hardware addresses,HINFO defualts and many others. I will include the list as it stands atthe moment, but if any RFC superceeds 1340, then it will have a morecomplete list. See Appendix B for that list.NOTE: If Chris had a very high profile and wanted his mac to appear like afully connected unix machine as far as internet services were concerned, hecould simply place an MX record such as IN MX 100 decelafter his machine and any mail sent to chris@chris-mac.ecel.uwa.edu.auwould be automatically rerouted to decel.The Reverse Mapping FileThe reverse name lookup is handled in a most bizarre fashion. Well it allmakes sense, but it is not immediately obvious.All of the reverse name lookups are done by finding the PTR recordassociated with the name w.x.y.z.in-addr.arpa. So to find the nameassociated with the IP number 1.2.3.4, we look for information stored inthe DNS under the name 4.3.2.1.in-addr.arpa. They are organised this wayso that when you are allocated a B class subnet for example, you get all ofthe IP numbers in the domain 130.95. Now to turn that into a reverse namelookup domain, you have to invert the numbers or your registered domainswill be spread all over the place. It is a mess and you need not understandthe finer points of it all. All you need to know is that you put thereverse name lookup files back to front.Here is the sample reverse name lookup files to go with our example.0.0.127.in-addr.arpa--; Reverse mapping of domain names 0.0.127.in-addr.arpa; Nobody pays attention to this, it is only so 127.0.0.1 -> localhost.@ IN SOA decel.ecel.uwa.edu.au. postmaster.ecel.uwa.edu.au. ( 91061801 ; Serial (yymmddxx) 10800 ; Refresh 3 hours 3600 ; Retry 1 hour 3600000 ; Expire 1000 hours 86400 ) ; Minimum 24 hours;1 IN PTR localhost.ecel.uwa.edu.au.--4.95.130.in-addr.arpa--; reverse mapping of domain names 4.95.130.in-addr.arpa;@ IN SOA decel.ecel.uwa.edu.au. postmaster.ecel.uwa.edu.au. ( 92050300 ; Serial (yymmddxx format) 10800 ; Refresh 3hHours 3600 ; Retry 1 hour 3600000 ; Expire 1000 hours 86400 ) ; Minimum 24 hours2 IN PTR decel.ecel.uwa.edu.au.3 IN PTR accfin.ecel.uwa.edu.au.5 IN PTR chris-mac.ecel.uwa.edu.au.--It is important to remember that you must have a second start of authorityrecord for the reverse name lookups. Each reverse name lookup file musthave its own SOA record. The reverse name lookup on the 127 domain isdebatable seeing as there is likely to be only one number in the file andit is blatantly obvious what it is going to map to.The SOA details are the same as in the forward mapping.Each of the numbers listed down the left hand side indicates that the linecontains information for that number of the subnet. Each of the subnetsmust be the more significant digits. eg the 130.95.4 of an IP number130.95.4.2 is implicit for all numbers mentioned in the file.The PTR must point to a machine that can be found in the DNS. If the nameis not in the DNS, some versions of named just bomb out at this point.Reverse name lookups are not compulsory, but nice to have. It means thatwhen people log into machines, they get names indicating where they arelogged in from. It makes it easier for you to spot things that are wrongand it is far less cryptic than having lots of numbers everywhere. Also ifyou do not have a name for your machine, some brain dead protocols such astalk will not allow you to connect.Since I had this I had one suggestion of an alternative way to do thelocalhost entry. I think it is a matter of personal opinion so I'llinclude it here in case anyone things that this is a more appropriatemethod.The following is courtesy of jep@convex.nl (JEP de Bie) The way I did it was: 1) add in /etc/named.boot: primary . localhost primary 127.in-addr.ARPA. IP127(Craig: It has been suggested by Mark Andrews that this is a bad practice particularly if you have upgraded to Bind 4.9. You also run the risk of polluting the root name servers. This comes down to a battle of idealogy and practicality. Think twice before declaring yourself authorative for the root domain.) So I not only declare myself (falsely? - probably, but nobody is going to listen anyway most likely [CPR]:-) athorative in the 127.in-addr.ARPA domain but also in the . (root) domain. 2) the file localhost has: $ORIGIN . localhost IN A 127.0.0.1 3) and the file IP127: $ORIGIN 127.in-addr.ARPA. 1.0.0 IN PTR localhost. 4) and I have in my own domain file (convex.nl) the line: $ORIGIN convex.nl. localhost IN CNAME localhost. The advantage (elegancy?) is that a query (A) of localhost. gives the reverse of the query of 1.0.0.127.in-addr.ARPA. And it also shows that localhost.convex.nl is only a nickname to something more absolute. (While the notion of localhost is of course relative :-)). And I also think there is a subtle difference between the lines primary 127.in-addr.ARPA. IP127 and primary 0.0.127.in-addr.ARPA. 4.95.130.domain ============= JEP de Bie jep@convex.nl =============Delegating authority for domains within your domain:When you start having a very big domain that can be broken into logical andseperate entities that can look after their own DNS information, you willprobably want to do this. Maintain a central area for the things thateveryone needs to see and delegate the authority for the other parts of theorganisation so that they can manage themselves.Another essential piece of information is that every domain that existsmust have it NS records associated with it. These NS records denote thename servers that are queried for information about that zone. For yourzone to be recognised by the outside world, the server responsible for thezone above you must have created a NS record for your machine in yourdomain. For example, putting the computer club onto the network and givingthem control over their own part of the domain space we have the following.The machine authorative for gu.uwa.edu.au is mackerel and the machineauthorative for ucc.gu.uwa.edu.au is marlin.in mackerel's data for gu.uwa.edu.au we have the following@ IN SOA ... IN A 130.95.100.3 IN MX mackerel.gu.uwa.edu.au. IN MX uniwa.uwa.edu.au.marlin IN A 130.95.100.4ucc IN NS marlin.gu.uwa.edu.au. IN NS mackerel.gu.uwa.edu.au.Marlin is also given an IP in our domain as a convenience. If they blow uptheir name serving there is less that can go wrong because people can stillsee that machine which is a start. You could place "marlin.ucc" in thefirst column and leave the machine totally inside the ucc domain as well.The second NS line is because mackerel will be acting as secondary nameserver for the ucc.gu domain. Do not include this line if you are notauthorative for the information included in the sub-domain.Troubleshooting your named:Named doesn't work! What is wrong?Step 1: Run nslookup and see what nameserver it tries to connect you to.If nslookup connects you to the wrong nameserver, create a /etc/resolv.conffile that points your machine at the correct nameserver. If there is noresolv.conf file, the the resolver uses the nameserver on the localmachine.Step 2: Make sure that named is actually running.Step 3: Restart named and see if you get any error messages on theconsole and in also check /usr/adm/messages.Step 4: If named is running, nslookup connects to the appropriatenameserver and nslookup can answer simple questions, but other programssuch as 'ping' do not work with names, then you need to install resolv+most likely.I changed my named database and my local machine has noticed, but nobodyelse has the new information?Change the serial number in the SOA for any domains that you modified andrestart named. Wait an hour and check again. The information propogatesout. It won't change immediately.My local machine knows about all the name server information, but no othersites know about me?Find an upstream nameserver (one that has an SOA for something in yourdomain) and ask them to be a secondary name server for you. eg if you areecel.uwa.edu.au, ask someone who has an SOA for the domain uwa.edu.au.Get NS records (and glue) added to your parent zone for your zone. This iscalled delegating. It should be done formally like this or you will getinconsistant answers out of the DNS. ALL NAMSERVERS FOR YOUR ZONE SHOULDBE LISTED IN THIS MANNER.My forward domain names work, but the backward names do not?Make sure the numbers are back to front and have the in-addr.arpa on theend.Make sure you reverse zone is registered. For Class C nets this can be doneby mailing to hostmaster@internic.net. For class A & B nets make sure thatyou are registeres with the primary for your net and that the net itselfis registered with hostmaster@internic.net.How to get useful information from nslookup:Nslookup is a very useful program but I'm sure there are less than 20people worldwide who know how to use it to its full usefulness. I'm mostcertainly not one of them. If you don't like using nslookup, there is atleast one other program called dig, that has most/all(?) of thefunctionality of nslookup and is a hell of a lot easier to use.I won't go into dig much here except to say that it is a lot easier to getthis information out of. I won't bother because nslookup ships with almostall machines that come with network software.To run nslookup, you usually just type nslookup. It will tell you theserver it connects to. You can specify a different server if you want.This is useful when you want to tell if your named information isconsistent with other servers.Getting name to number mappings.Type the name of the machine. Typing 'decel' is enough if the machine islocal.(Once you have run nslookup successfully)> decelServer: ecel.uwa.edu.auAddress: 130.95.4.2Name: decel.ecel.uwa.edu.auAddress: 130.95.4.2>One curious quirk of some name resolvers is that if you type amachine name, they will try a number of permutations. For example if mymachine is in the domain ecel.uwa.edu.au and I try to find a machinecalled fred, the resolver will try the following. fred.ecel.uwa.edu.au. fred.uwa.edu.au. fred.edu.au. fred.au. fred.This can be useful, but more often than not, you would simply prefer a goodway to make aliases for machines that are commonly referenced. If you arerunning resolv+, you should just be able to put common machines into thehost file.DIG: dig <machine name>Getting number to name mappings.Nslookup defaults to finding you the Address of the name specified. Forreverse lookups you already have the address and you want to find thename that goes with it. If you read and understood the bit above where itdescribes how to create the number to name mapping file, you would guessthat you need to find the PTR record instead of the A record. So you dothe following.> set type=ptr> 2.4.95.130.in-addr.arpaServer: decel.ecel.uwa.edu.auAddress: 130.95.4.22.4.95.130.in-addr.arpa host name = decel.ecel.uwa.edu.au>nslookup tells you that the ptr for the machine name2.4.95.130.in-addr.arpa points to the host decel.ecel.uwa.edu.au.DIG: dig -x <machine number>Finding where mail goes when a machine has no IP number.When a machine is not IP connected, it needs to specify to the world, whereto send the mail so that it can dial up and collect it every now and then.This is accomplished by setting up an MX record for the site and not givingit an IP number. To get the information out of nslookup as to where themail goes, do the following.> set type=mx> dialix.oz.auServer: decel.ecel.uwa.oz.auAddress: 130.95.4.2Non-authoritative answer:dialix.oz.au preference = 100, mail exchanger = uniwa.uwa.OZ.AUdialix.oz.au preference = 200, mail exchanger = munnari.OZ.AUAuthoritative answers can be found from:uniwa.uwa.OZ.AU inet address = 130.95.128.1munnari.OZ.AU inet address = 128.250.1.21munnari.OZ.AU inet address = 192.43.207.1mulga.cs.mu.OZ.AU inet address = 128.250.35.21mulga.cs.mu.OZ.AU inet address = 192.43.207.2dmssyd.syd.dms.CSIRO.AU inet address = 130.155.16.1ns.UU.NET inet address = 137.39.1.3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -