📄 made-easy
字号:
Path: pa.dec.com!decwrl!uunet!munnari.oz.au!uniwa!craigFrom: craig@ecel.uwa.edu.au (Craig Richmond - division)Newsgroups: comp.protocols.tcp-ip.domainsSubject: DNS Made Easy (Well that was the plan anyway)Date: 13 May 1993 10:39:31 GMTOrganization: The University of Western AustraliaLines: 529Distribution: inetMessage-ID: <1st8h3$laa@uniwa.uwa.edu.au>NNTP-Posting-Host: decel.ecel.uwa.edu.auSummary: A guide to installing and testing a domain name serverKeywords: FAQ DNS tutorial step by stepI have written this file because it seems that the same questions seem topop up time and time again and when I had to install DNS from scratch thefirst time, we found very little to help us.This document covers setting up a Domain Name Server with authority overyour domain and using a few of the more useful but less well known(hopefully this document will take care of that) features of nslookup toget information about the DNS and to work out why yours isn't working.If you are using a Sun Workstation and you want to make NIS interact withthe DNS, then this is not the FAQ for you (but it may well be when you tryto set up the DNS). If someone would like to provide a pointer to theappropriate FAQ (I'll include it in here). I have a copy of one particularset of instructions if you need it.An Overview of the DNS:The Domain Name System is the software that lets you have name to numbermappings on your computers. The name decel.ecel.uwa.edu.au is the number130.95.4.2 and vice versa. This is achieved through the DNS. The DNS is aheirarchy. There are a small number of root domain name servers that areresponsible for tracking the top level domains and who is under them. Theroot domain servers between them know about all the people who have nameservers that are authoritive for domains under the root.Being authoritive means that if a server is asked about something in thatdomain, it can say with no ambiguity whether or not a given piece ofinformation is true. For example. We have domains x.z and y.z. There areby definition authoritive name servers for both of these domains and weshall assume that the name server in both of these cases is a machinecalled nic.x.z and nic.y.z but that really makes no difference.If someone asks nic.x.z whether there is a machine called a.x.z, thennic.x.z can authoritively say, yes or no because it is the authoritive nameserver for that domain. If someone asks nic.x.z whether there is a machinecalled a.y.z then nic.x.z asks nic.y.z whether such a machine exists (andcaches this for future requests). It asks nic.y.z because nic.y.z is theauthoritive name server for the domain y.z. The information aboutauthoritive name servers is stored in the DNS itself and as long as youhave a pointer to a name server who is more knowledgable than yourself thenyou are set.When a change is made, it propogates slowly out through the internet toeventually reach all machines. This can take a couple of days, but in allreality I have no idea how long the worst case is.Installing the DNS:First I'll assume you already have a copy of the Domain Name Serversoftware. It is probably called named or in.named depending on yourflavour of unix. I never had to get a copy, but if anyone thinks thatinformation should be here then by all means tell me and I'll put it in.First step is to create the file named.boot. This describes to named(we'll dispense with the in.named. Take them to be the same) where theinformation that it requires can be found. This file is normally found in/etc/named.boot and I personally tend to leave it there because then I knowwhere to find it. If you don't want to leave it there but place it in adirectory with the rest of your named files, then there is usually anoption on named to specify the location of the boot file.Your typical boot file will look like this if you are an unimportant leafnode and there are other name servers at your site.directory /etc/namedfilesprimary ecel.uwa.edu.au ecel.uwa.domainprimary 0.0.127.in-addr.arpa 4.95.130.domainprimary 4.95.130.in-addr.arpa 4.95.130.domaincache . root.cacheThe lines mean the following.directoryThis is the path that named will place in front of all file namesreferenced from here on. If no directory is specified, it looks for filesrelative to /etc.primaryThis is a domain for which this domain is probably authorative for. Youput the entire domain name in. You need forwards and reverse lookups. Thefirst value is the domain to append to every name included in that file.(There are some exceptions, but they will be explained later) The name atthe end of the line is the name of the file (relative to /etc of thedirectory if you specified one). The filename can have slashes in it torefer to subdirectories so if you have a lot of domains you may want tosplit it up.BE VERY CAREFUL TO PUT THE NUMBERS BACK TO FRONT FOR THE REVERSE LOOK UPFILE. The hypothetical (or at the moment real) example given above is forthe subnet ecel.uwa.edu.au whose IP address is 130.95.4.*. The reversename must be 4.95.130.in-addr.arpa. It must be backwards and it must endwith .in-addr.arpa. If your reverse name lookups don't work, check this.If they still don't work, check this again.cacheThis is the information that named uses to get started. Named must knowthe IP number of some other name servers at least to get started.Information in the cache is treated differently depending on your versionof named. Some versions of named use the information included in the cachepermenantly and others retain but ignore the cache information once up andrunning.secondary (This line is not in the example, but is worth mentioning.A secondary line indicates that you wish to be a secondary name server forthis domain. You do not need to do this usually. All it does is help makethe DNS more robust. You should have at least one secondary server foryour site, but you do not need to be a secondary server for anyone else.You can by all means, but you don't need to be. If you want to be asecondary server for another domain, then place the linesecondary gu.uwa.edu.au 130.95.100.3 130.95.128.1in your named.boot. This will make your named try the servers on both ofthe machines specified to see if it can obtain the information about thosedomains. You can specify some number of IP addresses for the machines toquery that probably depends on your machine. The numbers 3 and 10 springto mind, but I can't remember where from. Your copy of named will uponstartup go and query all the information it can get about the domain inquestion and remember it and act as though it were authoritive for thatdomain.Next you will want to start creating the data files that contain the namedefinitions.The file ecel.uwa.edu.au. will be used for the example with a couple ofmachines left in for the purpose of the exercise. Here is a copy of whatthe file looks like with explanations following.; Authoritative data for ecel.uwa.edu.au;@ IN SOA decel.ecel.uwa.edu.au. postmaster.ecel.uwa.edu.au. ( 93051000 ; Serial (yymmddxx) 10800 ; Refresh 3 hours 3600 ; Retry 1 hour 3600000 ; Expire 1000 hours 86400 ) ; Minimum 24 hours IN A 130.95.4.2 IN MX 100 decel IN MX 200 munnari.oz.au. IN MX 500 uunet.UU.NET.localhost IN A 127.0.0.1decel IN A 130.95.4.2 IN HINFO SUN4/75 UNIX IN MX 100 decel IN MX 200 munnari.oz.au. IN MX 500 uunet.UU.NET.gopher IN CNAME decel.ecel.uwa.edu.au.accfin IN A 130.95.4.3 IN HINFO SUN4/75 UNIX IN MX 100 decel IN MX 200 munnari.oz.au. IN MX 500 uunet.UU.NET.chris-mac IN A 130.95.4.5 IN HINFO MACIICi SYS7.1The comment character is ';' so the first two lines are just commentsindicating the contents of the file.All values from here on have IN in them. This indicates that the value isan InterNet record. There are a couple of other types, but all you needconcern yourself with is internet ones.The SOA record is the Start Of Authority record. It contains theinformation that other nameservers will learn about this domain and how totreat the information they are given about it. The '@' as the firstcharacter in the line indicates that you wish to define things about thedomain for which this file is responsible. The domain name is found in thenamed.boot file in the corresponding line to this filename. Allinformation listed refers to the most recent machine/domain name so allrecords from the '@' until 'localhost' refer to the '@'. The SOA recordhas 5 magic numbers. First magic number is the serial number. If youchange the file, change the serial number. If you don't, no other nameservers will update their information. The old information will sit aroundfor a very long time. Refresh is the time between refreshing informationabout the SOA (correct me if I am wrong). Retry is the frequency ofretrying if an authorative server cannot be contacted. Expire is how oldthe information must become before it is dumped. This is to help theinformation withstand fairly lengthy downtimes of machines or connectionsin the network without having to recollect all the information. The twopieces of information before the 5 magic numbers are the machine that isconsidered the origin of all of this information. Generally the machinethat is running your named is a good one for here. The second is an emailaddress for someone who can fix any problems that may occur with the DNS.Good ones here are postmaster, hostmaster or root. NOTE: You use dots andnot '@' for the email address. eg root.decel.ecel.uwa.edu.au is correctand root@decel.ecel.uwa.edu.au is incorrect.We now have an address to map ecel.uwa.edu.au to. The address is130.95.4.2 which happens to be decel, our main machine. If you try to findan IP number for the domain ecel.uwa.edu.au it will get you the machinedecel.ecel.uwa.edu.au's IP number. This is a nicety which means thatpeople who have non-MX record mailers can still mail fred@ecel.uwa.edu.auand don't have to find the name of a machine name under the domain to mail.Now we have a couple of MX records for the domain itself. The MX recordsspecify where to send mail destined for the machine/domain that the MXrecord is for. In this case we would prefer if all mail forfred@ecel.uwa.edu.au is sent to decel.ecel.uwa.edu.au. If that does notwork, we would like it to go to munnari.oz.au because there are a number ofmachines that might have no idea how to get to us, but may be able to getto munnari. And failing that, try the site uunet.uu.net. A small numberindicates that this site should be tried first. The larget the number thefurther down the list of sites to try the site is. NOTE: Not all machineshave mailers that pay attention to MX records. Some only pay attention toIP numbers. NOTE: This is really stupid.There is an entry for localhost now. Note that this is somewhat of akludge and should probably be handled far more elegantly. By placinglocalhost here, a machine comes into existance calledlocalhost.ecel.uwa.edu.au. If you finger it, or telnet to it, you get yourown machine, because the name lookup returns 127.0.0.1 which is the specialcase for your own machine. I have used a couple of different DNS packages.The old BSD one let you put things into the cache which would always work,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.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 pornographic quicktimemovies on our gopher server (no we haven't and we don't intend to) causesan unbearable 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 porno pictures 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 now have the record for another unix machine called accfin. Nothingspecial here, but there are no CNAMEs that point to this machine. Perhapswe should put gopher there instead. Much less load on decel then.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 macIIci running System 7.1. Take this information with a grain ofsalt because in 5 years time, he will probably still be using a macIIcirunning system 7.1 because nobody ever keeps the DNS information up to
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -