📄 made-easy
字号:
date.NOTE: If Chris had a very high profile and wanted his mac to appear like aunix machine as far as internet services were concerned, he could simplyplace 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.Reverse Name Lookups:The 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;@ 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.--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.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.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.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.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.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. Simple 'decel' is enough. One curious quirkof some name resolvers is that if you type a machine name, they will try anumber of permutations. For example if my machine is in the domainecel.uwa.edu.au and I try to find a machine called fred, the resolver willtry 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.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.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.3You tell nslookup that you want to search for mx records and then you giveit the name of the machine. It tells you the preference for the mail(small means more preferable), and who the mail should be sent to. It alsoincludes sites that are authorative (have this name in their named databasefiles) for this MX record. There are multiple sites as a backup. As canbe seen, our local public internet access company dialix would like all oftheir mail to be sent to uniwa, where they collect it from. If uniwa isnot up, send it to munnari and munnari will get it to uniwa eventually.NOTE: For historical reasons Australia used to be .oz which was changed to.oz.au to move to the ISO standard extensions upon the advent of IP. Weare now moving to a more normal heirarchy which is where the .edu.au comesfrom. Pity, I liked having oz.Getting a list of machines in a domain from nslookup.Find a server that is authorative for the domain or just generally allknowing. To find a good server, find all the soa records for a givendomain. To do this, you set type=soa and enter the domain just like in thetwo previous examples.Once you have a server type > ls gu.uwa.edu.au.[uniwa.uwa.edu.au]Host or domain name Internet address gu server = mackerel.gu.uwa.edu.au gu server = uniwa.uwa.edu.au gu 130.95.100.3 snuffle-upagus 130.95.100.131 mullet 130.95.100.2 mackerel 130.95.100.3 marlin 130.95.100.4 gugate 130.95.100.1 gugate 130.95.100.129 helpdesk 130.95.100.180 lan 130.95.100.0 big-bird 130.95.100.130to get a list of all the machines in the domain.If you wanted to find a list of all of the MX records for the domain, youcan put a -m flag in the ls command.> ls -m gu.uwa.edu.au.[uniwa.uwa.edu.au]Host or domain name Metric Host gu 100 mackerel.gu.uwa.edu.au gu 200 uniwa.uwa.edu.auThis only works for a limited selection of the different types.Well that about wraps it up. If anyone else has any questions or answersor comments they think should be in here, mail me and I'll add them. I'llalso probably set up an automated posting thing so that this file getsposted to the newsgroup once a month or so. Hope all of this informationhelps someone. I had to learn it all the hard way and if I can savesomeone that trouble it will have been worth it.(P.S. I haven't proof read this so if there are any gaping holes, let meknow ASAP so I can fix them)Craig--Craig Richmond. Computer Officer - Dept of Economics (morning) 380 3860 University of Western Australia Dept of Education (afternoon) 2388craig@ecel.uwa.edu.au Dvorak Keyboards RULE! "Messes are only acceptableif users make them. Applications aren't allowed this freedom" I.M.VI 2-4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -