CS476/576
Assignment #1
Due Midnight,
Wednesday
Sept 29, 2004
Write a shell script (in any shell you
like)
with the following descriptions:
NAME
cslookup -
computer science (cs) departments hosts lookup
SYNOPSIS
cslookup
university_name
DESCRIPTION
The cslookup command
is a shell program that uses the UNIX command nslookup to discover some machine names and
IP addresses of the computer science (cs) departments in the USA
universities (edu).
Most cs departments have a file transfer protocol (ftp) hosts.
Thus it is likely to find machines with names such as:
ftp.cs.odu.edu
ftp.cs.unc.edu
ftp.cs.duke.edu
ftp.cs.harvard.edu
For example:
>
nslookup ftp.cs.odu.edu
Server:
sloth.cs.odu.edu
Address:
128.82.4.36
Name:
ocelot.cs.odu.edu
Address:
128.82.4.1
Aliases:
ftp.cs.odu.edu
This means that there are some machines at the cs department at ODU
that have the IP address of: 128.82.4.?
For example:
>
nslookup 128.82.4.4
Server:
sloth.cs.odu.edu
Address:
128.82.4.36
Name:
isis.cs.odu.edu
Address:
128.82.4.4
The
cslookup program simply lists the name and the IP address of those
machines that share the same first 3 octets of the ip address of the
ftp machine at the cs department of the specified university.
For example:
> cslookup odu
ftp.cs.odu.edu IP adress is: 128.82.4.1
IP: 128.82.4.1 Name:
ocelot.cs.odu.edu
IP: 128.82.4.2 Name:
xenon.cs.odu.edu
IP: 128.82.4.3 Name:
hutch.cs.odu.edu
.............more....
IP:
128.82.4.253 Name:
blackhole.cs.odu.edu
IP:
128.82.4.254 Name:
dbwebdev1.cs.odu.edu
IP:
128.82.4.255 Name:
eternity.cs.odu.edu
located 254 hosts at the same
subnet as ftp.cs.odu.edu
>
cslookup unc
ftp.cs.unc.edu IP adress is:
152.2.133.252
IP:
152.2.133.1 Name:
titus-cs.cs.unc.edu
IP:
152.2.133.3 Name:
antares.cs.unc.edu
IP:
152.2.133.4 Name:
vanosdol1-cs.cs.unc.edu
..........more.....
IP:
152.2.133.251 Name:
seca.cs.unc.edu
IP:
152.2.133.252 Name:
quartet.cs.unc.edu
IP:
152.2.133.253 Name:
ioglab2.cs.unc.edu
located
120 hosts at the same subnet as ftp.cs.unc.edu