0% found this document useful (0 votes)
74 views12 pages

Windows Networking Commands

Uploaded by

sheriff20abu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views12 pages

Windows Networking Commands

Uploaded by

sheriff20abu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

UNIVERSITY OF LIBERIA

DEPARTMENT OF COMPUTER
SCIENCE & TECHNOLOGY
FENDELL CAMPUS

Course Name: Computer Applications II

Course Short Name: CISC

Course code: 102

Section: Four (4)

Submitted by: Abu Sheriff

Identification Number: 97223

Submitted to: Miss Julateh Mulbah

Purpose: Assignment

Date: June 14, 2024


Windows Networking Commands
Windows networking commands are command-line tools that allow you to
manage network settings, troubleshoot network issues, and gather information
about your network.

1. ping Command:
The ping command checks network connectivity by sending ICMP echo
requests. Here are some common uses:

Ping an IP Address:
To test connectivity to an IP address:
ping [IP address]
Example: ping 8.8.8.8

Ping a website:
To check if a website responds:
ping [website]
Example: ping google.com

Continuous Ping:
To keep pinging continuously:
ping -t [IP address]
Example: ping -t 8.8.8.8

2. ipconfig Command:
The ipconfig command provides information about your network
configuration and allows you to refresh DHCP and DNS settings. Here
are some key points:

Basic Usage:
Open Command Prompt or PowerShell.
Type ipconfig and press Enter.
This displays basic network information, including your IP address, subnet
mask, and default gateway.

• Detailed Information (ipconfig /all):


To see more details, use the /all parameter: ipconfig /all.

This command provides additional information for each network adapter:


Physical Address (MAC address): Unique identifier for the adapter.
DHCP Enabled: Indicates if DHCP (automatic IP assignment) is used.
IPv4 Address: Your computer’s IP address.
Default Gateway: The router your computer is connected to.
DNS Servers: Translate domain names to IP addresses.
Link-Local IPv6 Address: IPv6 address (usually not used).

• Troubleshooting:
Use ipconfig /all to troubleshoot network issues.

Pay attention to:

IPv4 Address: Your assigned IP.


Default Gateway: Router/modem address.
DNS Servers: Used for domain name resolution.
DHCP Enabled: Should be “Yes” (unless manually configured).

• Refreshing Settings:
To reset or refresh network settings:
If DHCP is enabled, request a new IP address: ipconfig /release.
Renew IP addresses: ipconfig /renew.
3. Hostname Command
In windows, the hostname command allows you to view the host name
portion of the full computer name.

Basic Usage:
Open the Command Prompt (you can search for it in the Start menu).
Type hostname and press Enter.
The result will display the computer’s hostname without the domain.

Environment Variables:
The environment variable %COMPUTERNAME% usually prints the same string
as hostname, but in uppercase.
If the environment variable _CLUSTER_NETWORK_NAME_ is defined, hostname
will print its value.
Additional Information:
To get the actual domain on which the computer is connected, use the
ipconfig command and check the “Connection-specific DNS Suffix”
value1.
If you want to alter the hostname output, set the _CLUSTER_NETWORK_NAME_
variable and then run hostname. The hostname command is available
only if the Internet Protocol (TCP/IP) protocol is installed as a component
in the properties of a network adapter in Network.

4. getmac Command
The getmac command in Windows retrieves the media access control
(MAC) address and the list of network protocols associated with each
address for all network cards on a computer.

Basic Usage:
Open the Command Prompt (you can search for it in the Start menu).
Type getmac and press Enter.
You’ll see a list of physical addresses (MAC addresses) and transport
names used by each network adapter.

Parameters:
/s <computer>: Specifies the name or IP address of a remote computer
(default is the local computer).
/u <domain\\<user>>: Runs the command with specified user account
permissions.
/p <password>: Specifies the password for the user account.
/fo {table | list | csv}: Sets the output format (default is table).
/nh: Suppresses column headers in output.
/v: Displays verbose information.
/?: Shows help at the command prompt.

Examples:
To display a concise table: getmac /fo table /nh /v
To query a remote computer: getmac /s srvmain
To specify user credentials: getmac /s srvmain /u maindom\\hiropln /p p@ssW23
The getmac command provides essential network information, especially
when troubleshooting or analyzing network connections.

5. arp Command

The arp command is a utility used to manage the Address Resolution


Protocol (ARP) cache on a system. Let’s dive into the details:

Purpose:
ARP resolves IP addresses to MAC addresses within a Local Area
Network (LAN).
It operates between the Data Link Layer (Layer 2) and the Network
Layer (Layer 3).
The primary function is to map IP addresses to corresponding MAC
addresses.

Basic Usage:
To view the ARP cache, simply type arp in the Command Prompt (on
Windows) or the terminal (on Linux).
The output displays IP addresses, corresponding MAC addresses, and
interface information.

Options and Examples:


-v or --verbose: Shows detailed information.
-n or --numeric: Displays numerical addresses instead of symbolic host
names.
-a [hostname]: Lists entries for a specific host. If no hostname is provided,
all entries are displayed.
-d hostname: Explicitly removes an entry for a down host.
-s hostname hw_address: Manually adds an ARP address mapping entry.
-f filename: Reads entries from a file (similar to -s).
Common Files:
/proc/net/arp: Provides ARP cache details.
/etc/hosts/: Contains hostnames and IP addresses.
/etc/ethers: Stores Ethernet addresses.
The arp command helps troubleshoot network issues and manage address
mappings.

6. nslookup:

nslookup is a network administration command-line tool used for querying


DNS records.
It helps obtain domain names or IP address mappings and troubleshoot
DNS issues.
Available on various operating systems, including Windows, Linux, and
macOS.

Basic Usage:
Open the Command Prompt or Terminal.
Type nslookup followed by the domain name or IP address you want to
query.

For example:
To find the IP address for www.googl.com, type: nslookup www.google.com.
To perform a reverse DNS lookup (find the domain associated with an IP
address), use: nslookup [ip-address].

Common Options:
-type=a: View information about DNS A (address) records.
-type=mx: View Mail Exchange server information.
-type=ns: View Name Server records.
-type=ptr: View Pointer records (used in reverse DNS lookups).
-type=soa: View Start of Authority records.
You can also change the default DNS name, set timeouts, and specify
ports.

Example:
To find the IP address for www.exanple.com, type:
nslookup www.example.com
To perform a reverse lookup for an IP address (e.g., 8.8.8.8), use:
nslookup 8.8.8.8

7. nbtstat Command:

Purpose: nbtstat deals with NetBIOS over TCP/IP (NetBT) protocol.

Functionality:
Displays NetBIOS name tables (local and remote computers).
Shows NetBIOS name cache.
Refreshes NetBIOS name cache and WINS registrations.

Basic Usage:
nbtstat /n: Displays local NetBIOS name table.
nbtstat /a <remotename>: Shows remote NetBIOS name table.
nbtstat /c: Displays NetBIOS name cache.

Additional Options:
/r: NetBIOS name resolution statistics.
/R: Purges and reloads pre-tagged entries from Lmhosts file.
/RR: Releases and refreshes local NetBIOS names registered with WINS.

Note: nbtstat is case-sensitive and provides essential NetBIOS-related


information.
8. net Command

The net command is a powerful tool used to manage network resources


and services, such as viewing and configuring network settings, managing
network shares, and more. The net command provides various
functionalities related to networking and resource management. Here are
some key aspects:

Mapping Network Drives with net use:


The net use command allows you to map network drives (shared folders)
to local drive letters.
Syntax: net use [drive_letter:] \\server\share /user:<username> <password>.
Example: To map a network share named \\server\shared_folder to drive
letter Z:, use:
net use Z: \\server\shared_folder /user:myusername mypassword

You can also disconnect mapped drives using net use /delete.

Viewing Active Connections with netstat:


The netstat command displays active network connections, listening ports,
and protocol statistics.
Common usage:
netstat -a: Lists all active connections and listening ports.
netstat -t: Shows only TCP connections.
netstat -u: Displays only UDP connections.

Managing Network Resources with net:


net view: Lists shared resources (computers, printers, etc.) on the network.
net share: Manages shared resources (create, modify, delete shares).
net user: Manages user accounts (add, modify, delete users).
net group: Manages user groups.
net session: Lists active sessions on the server.

Other net Commands:


net time: Synchronizes the system time with a time server.
net send: Sends messages to other users on the network (deprecated in
modern Windows versions).
net accounts: Configures account policies.
net config: Displays or modifies network settings.

9. netstat Command:

Purpose: The netstat command provides information about network


connections, open ports, and protocol statistics.
Basic Usage: Running netstat without parameters displays active
established internet connections on the computer.

Columns in Output:
Proto: Protocol of the connection (TCP or UDP).
Recv-Q: Receive queue (bytes received or ready to be received).
Send-Q: Send queue (bytes ready to be sent).
Local address: Address and port of the local connection.
Foreign address: Address and port of the remote end of the connection.
State: State of the local socket (e.g., ESTABLISHED, LISTENING).

Useful Options:
-a: Displays all active TCP connections and listening ports.
-t: Lists all TCP ports.
-u: Lists all UDP ports.
-l: Lists only listening ports.

Note: Consider using the ss command as a faster and simpler alternative.

nbtstat Command:
Purpose: nbtstat deals with NetBIOS over TCP/IP (NetBT) protocol.

Functionality:
Displays NetBIOS name tables (local and remote computers).
Shows NetBIOS name cache.
Refreshes NetBIOS name cache and WINS registrations.

Basic Usage:
nbtstat /n: Displays local NetBIOS name table.
nbtstat /a <remotename>: Shows remote NetBIOS name table.
nbtstat /c: Displays NetBIOS name cache.

Additional Options:
/r: NetBIOS name resolution statistics.
/R: Purges and reloads pre-tagged entries from Lmhosts file.
/RR: Releases and refreshes local NetBIOS names registered with WINS.

Note: nbtstat is case-sensitive and provides essential NetBIOS-related


information.

10.Taskkill Command

The taskkill command in Windows allows you to end one or more tasks or
processes. You can terminate processes either by their process ID (PID) or by
their image name. Here are the details:

Basic Usage:
Open the Command Prompt (you can search for it in the Start menu).
Type taskkill followed by the appropriate options.
You can use the tasklist command to find the process ID (PID) of the process you
want to terminate.

Parameters:
/s <computer>: Specifies the name or IP address of a remote computer (default is
the local computer).
/u <domain\\<username>>: Runs the command with the account permissions of the
specified user.
/p <password>: Specifies the password for the user account.
/fi <filter>: Applies a filter to select specific tasks (e.g., by status, image name,
PID, etc.).
/pid <processID>: Specifies the process ID of the process to be terminated.
/im <imagename>: Specifies the image name of the process to be terminated
(wildcard * allowed).
/f: Forces processes to be ended (ignored for remote processes).
/t: Ends the specified process and any child processes it started.

Examples:
To end processes with PIDs 1230, 1241, and 1253: taskkill
/pid 1230 /pid 1241 /pid 1253
To forcefully end the Notepad.exe
process: taskkill /im Notepad.exe
To terminate unresponsive tasks: taskkill /fi "STATUS eq NOT RESPONDING"
Taskkill is a powerful tool for managing processes, especially when
troubleshooting or dealing with unresponsive applications.

You might also like