Appendix 6 | |
2.2.4 DNS
Before going over details of BIND(Berkley Internet Domain Name) system let us tune our
resolver to a name server available to our upstream editing the file /etc/resolv.conf
like: -------- /etc/resolv.conf file starts here ------- maple@junan:/usr/share/dict{1039}% nslookup So, the resolver looks at the the upstream nameserver and acts
accordingly. But we are going to setup our nameserver here. We would be using BIND to
setup our nameserver. It is bundled with the FreeBSD, so it is already installed in your
machine. We are going to ommit the installing process here as it is more or less same as
above. Here we will concentrate on the different configuration files. db.maple: maps host names to addresses. We will discuss these files below but we will unfortunately start with a
complete file rather than a blank file. So, here is the db.maple file after completion: ----------------- start of db.maple file ------------------- The first entry in each file is SOA(Source of Authority) records. We
should have been putting here the domain we are going to control, i.e.,
ant.yatsushiro-nct.ac.jp.(Yes, the trailing dot must be there) ? instead we put a symbol
in this place. '@' notation states that IN NS maple.ant.yatsushiro-nct.ac.jp. ; primary It indicates that there is a name server for our domain
ant.yatsushiro-nct.ac.jp. We can add other name servers with multiple lines here too.
There is another advantage of making maple name server for our domain ----- it is acting
as a router which means that other networks can access this host too. The omitted line is
a little bit complicated to explain in detail, just to point out a little is that it takes
care of the mails with the domain name attached. IN MX 10 maple.ant.yatsushiro-nct.ac.jp. ; mail Now db.192.168.0 file which maps back addresses to host names: ----------------- start of db.192.168.0 file ------------------- As it was mentioned earlier it maps back addresses to host names.
Actually we should have been putting lines like: 12.0.168.192.in-addr.arpa. IN PTR momo.ant.yatsushiro-nct.ac.jp. instead of: 12 IN PTR momo.ant.yatsushiro-nct.ac.jp. But by virtue of '@' notation we can replace
'12.0.168.192.in-addr.arpa.' with a last network number only - that's quite useful for us! ----------------- Start of db.127.0 file ------------------- It covers the loopback network used by a lot of programs. A name server
would work without this file but a lookup at 127.0.0.1 would fail. Hence, the necessity of
db.127.0.0 file. It should be more or less same anywhere. ----------------- Start of db.cache file ------------------- At last the named.boot file. It is the file that puts together all the
files described above. Here is the completed named.boot file: The first valid line indicates where all the data files are located.
Here, the location is in /etc/namedb, it can be anywhere, though a separate directory is
appreciated. The following lines contains three fields: first column with a word
'primary', second column is the domain the server authoritative for, third column is the
data filename. db.cache is read by the line: cache . db.cache You can see another line starting with the word 'forwards'. This line
tells the name server to query the host(202.251.33.1, i.e., our school name server) when
it fails to find the answer in it's cache. If a forwarder takes longer time to reply, our
name server will try to perform it itself. maple# /usr/sbin/named -b /etc/namedb/named.boot It should work nicely. If you get problems running the name server see
the error messages at the /var/log/messages file. It will perhaps give you a few details.
Now before trying with our new name server we should fix our /etc/resolv.conf file first.
The following lines should work just fine: maple@junan:/etc/namedb{1021}% cat /etc/resolv.conf Now we are ready to test our name server: maple@junan:/etc/namedb{1023}% nslookup It seems like working nicely! |
| Home | Introduction | An Overview of Our Network | System Administration | Security | Conclusion | Acknowledgements | References | Appendix 1 | Appendix 2 | Appendix 3 | Appendix 4 | Appendix 5 | Appendix 6 | Appendix 7 | Appendix 8 | Appendix 9 | Appendix 10 |
This page is maintained by:
jchakma@yahoo.com