Bus 111_Assignment 2_f24
Bus 111_Assignment 2_f24
In this assignment, you are going to learn about some important DOS commands that are widely used by
networking professionals.
Although DOS commands may seem archaic to those that grew up on Windows, many useful programs
still use a command-line interface. Learning command-line will become easier with practice. Knowing
how to use a command prompt will make the transition from Windows to Linux much easier.
This assignment covers just a few of the commands available. A larger list is available by typing “help” at
the DOS prompt. One of the main advantages of using DOS commands is that they will work on all
current versions of Windows in a command prompt. A network administrator can run DOS commands
on any Windows machine without installing additional software. This will save him/her time and money.
All versions of Windows will have a command prompt where you can run DOS commands. Windows 7
includes PowerShell, which has extended capabilities including being able to run many Linux/Unix/Mac
commands. To pull up a command prompt you can go through the start menu by clicking Start, All
Programs, Accessories, Command Prompt. Alternatively, you can click Start, Run and then type cmd.
Exercise 1: IPCONFIG
This command will give you a listing of your basic IP information for the computer you are using. You
will get your IP address, subnet mask, and default gateway (the computer that connects you to the
Internet). You will use your IP address for scanning, remote administration, penetration testing, etc.
Ipconfig will also allow you to manage your DNS resolver cache and renew your IP address with the
DHCP server. You will learn more about DNS and DHCP in later exercises.
In the second command you used the /all option to get more information about each adapter.
9. Type ipconfig /flushdns
10. Press Enter. (This will flush all DNS entries.)
11. Type ping www.google.com
12. Press Enter.
13. Type ipconfig /displaydns
14. Press Enter.
15. Scroll down until you see the entry for www.Google.com.
16. Take a screenshot.
17. Type ipconfig /all
18. Press Enter.
19. Take a screenshot.
20. Type ipconfig /renew
21. Press Enter. (This will renew all network adapters on your computer.)
22. Take a screenshot.
The DHCP server loaned you an IP address for a given amount of time. (In this case it was one day.) By
renewing your IP address you can reserve this same IP address for a longer amount of time. The
information provided by the ipconfig command will come in handy when you do the rest of the projects.
If you want a listing of all the possible options available for a given DOS command (ipconfig) you can just
type the name of the command followed by a question mark.
a. What is the practical difference between an IP address and a physical (MAC) address?
AN IP address is logical and can change based on the network, while the MAC address is a
physical address hard-coded into a device, and cannot change
b. What is the Default Gateway?
The default gateway is the router on which devices within a network communicate through to
reach devices on other networks.
c. What do DNS servers do?
DNS servers translate domain names into IP addresses for the purpose of human readability
d. What is a subnet mask?
The number in an IP address that separates the network and host parts of the address.
Exercise 2: PING
Ping is a command that will tell you if a host is reachable and alive. It sends out a packet that asks the
target computer to send it back a message saying it’s actually there. It also tells you how long it took to
get back and if any of the packets were lost. This is very useful if you need to see if a server/computer is
running. You can also diagnose latency and/or packet loss issues.
This example pings www.utah.edu repeatedly. Feel free to ping San Jose State University or Web site of
your choice. Instead of using “www.utah.edu” please use “www.sjsu.edu.” Timestamps will also be
included at the end of each example.
Tracert can also provide you with information about the route packets are taking over a network. It can
be surprising how many hops there are between you and a Web site that you visit. Oftentimes the route
a packet takes is not the shortest geographical distance. This example uses www.utah.edu repeatedly.
Feel free to use the hostname of your own university or any other Web site. Instead of using
“www.utah.edu” please use “www.sjsu.edu.”
1. Click Start and Run.
2. Type cmd
3. Press Enter.
4. Type tracert www.utah.edu
5. Press Enter. (This will list every computer on the route between your computer and
www.utah.edu.)
6. Type tracert www.google.com
7. Press Enter. (This will list every computer on the route between your computer and
www.Google.com.)
8. Type time
9. Press Enter twice.
10. Take a screenshot.
11. Type tracert www.google.com -d
12. Press Enter.
13. Type tracert www.google.com –h 5
14. Press Enter.
15. Type time
16. Press Enter twice.
17. Take a screenshot.
18. Type pathping www.utah.edu –q 5 –w 5
19. Press Enter.
20. Type time
21. Press Enter twice.
22. Take a screenshot.
23. Type pathping www.google.com –q 5 –w 5
24. Press Enter.
25. Type time
26. Press Enter twice.
27. Take a screenshot.
Exercise 4: NETSTAT
Netstat is the command that lists all current network connections, connection statistics, and routing
tables on your computer. The default netstat command will give you a listing of all of the ports open on
your computer as well as the foreign address of the computer you’re connected to.
Ports are like doors on your house. Information packets are addressed to a specific IP address (location)
and port number (point of entry). Your house works the same way. It has an address (location) and door
(point of entry) where packages are delivered. Netstat can tell you which programs are
sending/receiving information to/from your computer.
The -a option will show all of the ports (including UDP ports) that may be open on your machine. The -n
option will show the local and foreign addresses for each connection. The -e option will display statistics
about the number of packets sent/received, errors, and packets that were discarded.
9. Type cls
10. Press Enter.
11. Type netstat -a
12. Press Enter.
13. Take a screenshot.
14. Type cls
15. Press Enter.
16. Type netstat -n
17. Press Enter.
18. Take a screenshot.
19. Type netstat -e
20. Press Enter.
21. Take a screenshot.
Using the -n option you can see which external computers are connected to your computer and which
port(s) they are using. Knowing which foreign address your computer is connecting to can be helpful if
you want to be sure where your data is going to or coming from. The -e option is a quick way to tell if
you are sending/receiving packets and if you are getting a large number of errors. This will help you
identify a bad network card, cable, or configuration issue.
Exercise 5: NSLOOKUP
Nslookup is a command that will give you all of the IP addresses that are associated with a given domain
name from the local DNS server (it’s like an Internet phone book). For example, if you wanted to find the
IP addresses of www.CNN.com you could use nslookup to identify them. Nslookup is also useful for
solving DNS problems.
There are two modes when you use nslookup (non-interactive and interactive). You will use the non-
interactive mode for this exercise and can learn more about the interactive mode here:
http://support.microsoft.com/kb/200525.
1. Click Start.
2. In the search box type cmd
3. Press Enter.
4. Type nslookup www.sjsu.edu
5. Press Enter.
6. Type nslookup www.google.com
7. Press Enter.
8. Type time
9. Press Enter twice.
10. Take a screenshot. (See Figure 1-32.)