We mentioned several web sites in the class. Here is a list:
We mentioned two books on the course that you should consider buying. If you need to administer DNS buy DNS and BIND, 3rd Edition by Paul Albitz and Cricket Liu. For managing NIS or NFS consider Managing NFS and NIS by Hal Stern.
This lab sets up a master DNS server on a machine named instructor.harper.edu. You'll want to change instructor.harper.edu to match your machine's address, and it's IP address as well.
1) Populate /etc/resolv.conf
domain harper.edu nameserver 127.0.0.1
2) Create a directory for named
mkdir /usr/local mkdir /usr/local/adm mkdir /usr/local/adm/named
3) Create the local zone, in /usr/local/adm/named/db.127.0.0
0.0.127.in-addr.arpa. IN SOA instructor.harper.edu. postmaster.instructor.harper.edu. (
1 ; serial number
10800 ; refresh time
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 ); Minimum TTL of 1 day
0.0.127.in-addr.arpa. IN NS instructor.harper.edu.
1.0.0.127.in-addr.arpa. IN PTR localhost.
4a) Create the harper zone in db.harper
harper.edu. IN SOA instructor.harper.edu. postmaster.instructor.harper.edu. (
1 ; serial number
10800 ; refresh time
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 );
harper.edu. NS instructor.harper.edu. ; This is a nameserver entry.
instructor.harper.edu. IN A 131.107.2.100 ; This is an address entry.
student11.harper.edu. IN A 131.107.2.111 ; This is an address entry.
4b) Now create the reverse lookup map in db.2.107.131
2.107.131.in-addr.arpa. IN SOA instructor.harper.edu. postmaster.instructor.harper.edu. (
1 ; serial number
10800 ; refresh time
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 );
2.107.131.in-addr.arpa. IN NS instructor.harper.edu ; Who is my nameserver for this domain?
100.2.107.131.in-addr.arpa. IN PTR instructor.harper.edu.
111.2.107.131.in-addr.arpa. IN PTR student11.harper.edu.
5) Create /etc/named.conf
options {
directory "/usr/local/adm/named";
};
zone "0.0.127.in-addr.arpa" in {
type master;
file "db.127.0.0";
};
zone "harper.edu" in {
type master;
file "db.harper";
};
zone "2.107.131.in-addr.arpa" in {
type master;
file "db.2.107.131";
};
6) Try running a simple nslookup for student11.
7) Try performing a telnet to student11. You should be unable to lookup the host.
8) Now fix /etc/nsswitch.conf
Examine the difference between nsswitch.conf and nsswitch.dns with diff:
diff nsswitch.dns nsswitch.conf
Now fix nsswitch.conf
cp nsswitch.dns nsswitch.conf
9) Now try performing a telnet. Now you should be able to lookup the host.
10) Try a reverse lookup with nslookup
> set type=PTR > 131.107.2.100 Server: localhost Address: 127.0.0.1 100.2.107.131.in-addr.arpa name = instructor.harper.edu 2.107.131.in-addr.arpa nameserver = instructor.harper.edu.2.107.131.in-addr.arpa > quit Server: localhost Address: 127.0.0.1