Network Commands
Network Commands
Network Commands
systems. Each command includes additional information to what the command does, the command's syntax, and miscellaneous information. Note: If you are not the root or admin of a computer, it is possible for these commands to be disabled or revoked.
Arp Finger Hostname Ipconfig Pathping Ping Nbtstat Net Netstat Nslookup Route Tracert and Traceroute Whois Winipcfg
ARP Display or manipulate the ARP information on a network device or computer. About arp Displays, adds and removes arp information from network devices. Availability The arp.exe command is an external command accessed through the C:\Windows or C:\Winnt\System32 directory and is available in the below Microsoft operating systems. Windows 95, Windows 98, Windows ME, Windows NT Windows 2000, Windows XP Windows Vista, Windows 7 Syntax ARP -s inet_addr eth_adr [if_addr] ARP -d inet_addr [if_addr] ARP -a [inet_addr] [-N if_addr]
-a Displays current ARP entries by interrogating the current protocol data. If inet_addr is specified, the IP and Physical addresses for only the specified computer are displayed. If more than one network interface uses ARP, entries for each ARP table are displayed. Same as -a
-g
inet_addr Specifies an Internet address. -N if addr Displays the ARP entries for the network interface specified by if_addr. -d Deletes the host specified by inet_addr.
-s
Adds the host and associates the Internet address inet_addr with the Physical address eth_addr. The Physical address is given as 6 hexadecimal bytes seperated by hyphens. The entry is permanent. Specifies a physical address If present, this specifies the Internet address of the interface whose address translation table should be modified. If not present, the first applicable interface will be used.
eth_addr if_addr
The Physical Address or MAC address as shown above in the format aa-bb-cc-dd-ee-ff is the unique manufacturer identification number. This number should always be an unique address. An example of how to change the above IP address 220.0.0.160 to 220.0.0.161 in this case would be: arp -s 220.0.0.161 00-50-04-62-F7-23 If an IP address has already been assigned to the specific network adapter it is not possible to change that assigned IP address to a new address. In addition, networks italicizing DHCP, BOOTP or RARP will automatically assign the card an IP address, therefore, this command would not be utilized. FINGER The finger command available in Unix and Linux variants allows a user to find sometimes personal information about a user. This information can include the last time the user logged in, when they read their e-mail, etc... If the user creates a .PLAN or other related file the user can also display additional information. HOSTNAME The hostname command displays the host name of the Windows XP computer currently logged into. About hostname Display the hostname of the machine the command is being run on. Availability The hostname command is an external command and is available in the below Microsoft operating systems. Windows 2000, Windows XP Windows Vista, Windows 7
Syntax hostname sethostname: Use the Network Control Panel Applet to set hostname. hostname -s is not supported. Examples hostname Running the command would display the hostname for the computer.
IPCONFIG Ipconfig is a MS-DOS utility that can be used from MS-DOS and a MS-DOS shell to display the network settings currently assigned and given by a network. This command can be utilized to verify a network connection as well as to verify your network settings. Windows 2000 users should use this command to determine network information. About ipconfig Ipconfig is a DOS utility that can be used from MS-DOS and a MS-DOS shell to display the network settings currently assigned and given by a network. This command can be utilized to verify a network connection as well as to verify your network settings. Availability The ipconfig.exe command is an external command and is available in the below Microsoft operating systems. Windows 95, Windows 98, Windows ME, Windows 2000, Windows XP Windows Vista, Windows 7 Windows 95, 98, and ME syntax
/All /Batch [file] /renew_all /release_all /renew N /release N Display detailed information. Write to file or ./WINIPCFG.OUT Renew all adapters. Release all adapters. Renew adapter N. Release adapter N.
Windows 2000 and XP syntax ipconfig [/? | /all | /release [adapter] | /renew [adapter] | /flushdns | /registerdns | /showclassid adapter | /setclassid adapter [classidtoset] ]
/all /release /renew /flushdns /registerdns /displaydns Display full configuration information. Release the IP address for the specified adapter. Renew the IP address for the specified adapter. Purges the DNS Resolver cache. Refreshes all DHCP leases and re-registers DNS names Display the contents of the DNS Resolver Cache.
/showclassid Displays all the dhcp class IDs allowed for adapter. /setclassid Modifies the dhcp class id.
The default is to display only the IP address, subnet mask and default gateway for each adapter bound to TCP/IP. For Release and Renew, if no adapter name is specified, then the IP address leases for all adapters bound to TCP/IP will be released or renewed. For SetClassID, if no class id is specified, then the classid is removed. Examples To get your computers local network IP address, subnet mask, and default gateway typing ipconfig alone will display this information as shown below. Keep in mind this is only your local network information. If you're trying to determine your IP address used on the Internet we suggest viewing our system information page. ipconfig Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : hsd1.ut.comcast.net. IP Address. . . . . . . . . . . . : 192.168.201.245 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.201.1 To get all local network information for your computer use the /all switch as shown below, followed by the results that would be seen when using this command. ipconfig /all Windows IP Configuration Host Name . . . . . . . . . : COMPUTERH1
DNS Servers . . . . . . . . : 123.45.67.8 111.111.111.1 111.111.111.1 Node Type . . . . . . . . . : Broadcast NetBIOS Scope ID. . . . . . : IP Routing Enabled. . . . . : No WINS Proxy Enabled. . . . . : No NetBIOS Resolution Uses DNS : No 0 Ethernet adapter : Description . . . . . . . . : PPP Adapter. Physical Address. . . . . . : 44-44-44-54-00-00 DHCP Enabled. . . . . . . . : Yes IP Address. . . . . . . . . : 123.45.67.802 Subnet Mask . . . . . . . . : 255.255.0.0 Default Gateway . . . . . . : 123.45.67.801 DHCP Server . . . . . . . . : 255.255.255.255 Primary WINS Server . . . . : Secondary WINS Server . . . : Lease Obtained. . . . . . . : 01 01 80 12:00:00 AM Lease Expires . . . . . . . : 01 01 80 12:00:00 AM 1 Ethernet adapter : Description . . . . . . . . : 3Com 3C90x Ethernet Adapter Physical Address. . . . . . : 00-50-04-62-F7-23 DHCP Enabled. . . . . . . . : Yes IP Address. . . . . . . . . : 111.111.111.108 Subnet Mask . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . : 111.111.111.1 DHCP Server . . . . . . . . : 111.111.111.1 Primary WINS Server . . . . : Secondary WINS Server . . . : Lease Obtained. . . . . . . : 11 16 00 12:12:44 AM Lease Expires . . . . . . . : ipconfig /displaydns Running the above command would display all the DNS information. ipconfig /flushdns Delete all DNS entries. PATHPING Pathping is a MS-DOS utility available for Microsoft Windows 2000 and Windows XP users. This utility enables a user to find network latency and network loss. About pathping
Similar to the tracert command, pathping provides users with the ability of locating spots that have network latency and network loss. Availability The pathping.exe command is an external command that is available in the below Microsoft operating systems. Windows 2000, Windows XP Windows Vista, Windows 7 Syntax Windows 2000 Syntax
Usage: pathping [-n] [-h maximum_hops] [-g host-list] [-p period] [-q num_queries] [-w timeout] [-t] [-R] [-r] target_name
Options:
-n Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target. -g host-list -p period -q num_queries -w timeout -T -R Loose source route along host-list. Wait period milliseconds between pings. Number of queries per hop. Wait timeout milliseconds for each reply. Test connectivity to each hop with Layer-2 priority tags. Test if each hop is RSVP aware.
Windows XP Syntax
Usage: pathping [-g host-list] [-h maximum_hops] [-i address] [-n] [-p period] [-q num_queries] [-w timeout] [-P] [-R] [-T] [-4] [-6] target_name
Options:
-g host-list Loose source route along host-list.
-h maximum_hops Maximum number of hops to search for target. -i address Use the specified source address.
Do not resolve addresses to hostnames. Wait period milliseconds between pings. Number of queries per hop. Wait timeout milliseconds for each reply. Test for RSVP PATH connectivity. Test if each hop is RSVP aware. Test connectivity to each hop with Layer-2 priority tags. Force using IPv4. Force using IPv6.
Examples pathping computerhope.com Tracing route to computerhope.com [204.228.150.3] over a maximum of 30 hops: 0 Hope [192.168.120.101] 1 192.168.120.254 2 ... Computing statistics for 50 seconds...
Source to Here This Node/Link HopRTT Lost/Sent = Pct Lost/Sent = Pct Address
0 1 2
0 Hope [192.168.120.101] 0/100 = 0% | 0ms0/ 100 = 0% 0/100 = 0% 192.168.120.254 100/100 = 100%| --- 100/100 = 100%0/100 = 0% Hope [0.0.0.0]
Trace complete.
PING Ping is one of the most commonly used and known commands. Ping allows a user to ping another network IP address. This can help determine if the network is able to communicate with the network. About ping Helps in determining TCP/IP Networks IP address as well as determine issues with the network and assists in resolving them. Availability
The ping.exe command is an external command that is available in the below Microsoft operating systems. Windows 95, Windows 98, Windows ME, Windows NT Windows 2000, Windows XP Windows Vista, Windows 7 Syntax
ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] destination-list Options: -t Pings the specified host until stopped. To see statistics and continue - type Control-Break; To stop - press Ctrl + C. Resolve addresses to hostnames. Number of echo requests to send. Send buffer size. Set Don't Fragment flag in packet. Time To Live. Type Of Service. Record route for count hops. Timestamp for count hops. Loose source route along host-list. Strict source route along host-list. Timeout in milliseconds to wait for each reply.
Examples ping localhost Pings the local host, this will allow you to see if the computer is able to send information out and receive the information back. Note that this does not send information over a network but may allow you to see if the card is being seen. ping xxx.xxx.xxx.xxx
Allows you to ping another computer where the x's are located are where you would place the IP address of the computer you are attempting to ping. If this is not able to complete, this should relay back an unsuccessful message, which could be an indication of cable issues, network card issues, hub issue, etc. ping computerhope.com PING computerhope.com (204.228.150.3) 56(84) bytes of data. 64 bytes from www.computerhope.com (204.228.150.3): icmp_seq=1 ttl=63 time=0.267 ms --- computerhope.com ping statistics --1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.267/0.267/0.267/0.000 ms Additional information Is there a continuous ping options? ping <address> -t Use the -t option to ping any address until you cancel it by pressing Ctrl + C. NBTSTAT The nbtstat MS-DOS utility that displays protocol statistics and current TCP/IP connections using NBT.
See the nbtstat command page for further help on this MS-DOS and Windows command.
NET The net command is available in MS-DOS and Windows and is used to set, view and determine network settings. About net The net command is used to update, fix, or view the network or network settings. Listed in the Syntax we have listed each of net commands. Availability The net.exe command is an external command that is available in the below Microsoft operating systems. Windows 95, Windows 98, Windows NT, Windows ME Windows 2000, Windows XP Windows Vista, Windows 7 Syntax Windows XP syntax NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP | HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION | SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]
NET ACCOUNTS
[SERVER | WORKSTATION]
NET CONTINUE Continues the use of service.
[service]
NET FILE Display opened shared files on the server.
[id [/CLOSE]]
NET GROUP Add, delete, view, and otherwise manage network workgroups.
[groupname [/COMMENT:"text"]] [/DOMAIN] groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN] groupname username [...] {/ADD | /DELETE} [/DOMAIN]
NET LOCALGROUP Add, delete, view, and otherwise manage network groups.
[groupname [/COMMENT:"text"]] [/DOMAIN] groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN] groupname name [...] {/ADD | /DELETE} [/DOMAIN]
NET NAME Create or delete name used for messaging.
[service]
NET PRINT Manage network print jobs.
You can send a message only to an name that is active on the network. If the message is sent to a username, that user must be logged on and running the Messenger service to receive the message.
[\\computername] [/DELETE]
NET SHARE Create and manage a local network share.
sharename sharename=drive:path [/USERS:number | /UNLIMITED] [/REMARK:"text"] [/CACHE:Manual | Documents| Programs | None ] sharename [/USERS:number | /UNLIMITED] [/REMARK:"text"] [/CACHE:Manual | Documents | Programs | None] {sharename | devicename | drive:path} /DELETE
NET START Start the specified network service.
[service]
NET STATISTICS Display network statistics of the workstation or server.
[WORKSTATION | SERVER]
NET STOP Stop the specified network service.
service
NET TIME Display the time and date of another network computer.
[\\computername | /DOMAIN[:domainname] | /RTSDOMAIN[:domainname]] [/SET] [\\computername] /QUERYSNTP [\\computername] /SETSNTP[:ntp server list]
NET USE Connects or disconnects your computer from a shared resource or displays information about your connections.
[devicename | *] [\\computername\sharename[\volume] [password | *]] [/USER:[domainname\]username] [/USER:[dotted domain name\]username] [/USER:[username@dotted domain name] [/SMARTCARD] [/SAVECRED] [[/DELETE] | [/PERSISTENT:{YES | NO}]] NET USE {devicename | *} [password | *] /HOME NET USE [/PERSISTENT:{YES | NO}]
NET USER Displays users on the computer or domain.
[\\computername [/CACHE] | /DOMAIN[:domainname]] NET VIEW /NETWORK:NW [\\computername] Windows 2000 syntax
NET CONFIG Displays your current workgroup settings.
NET DIAG
Runs the Microsoft Network Diagnostics program to test the hardware connection between two computers and to display information about a single computer. NET DIAGNOSTICS [/NAMES | /STATUS] /NAMES Specifies a diagnostic server name in order to avoid conflicts when NET DIAG is used simultaneously by multiple users. This option works only when the network uses a NetBIOS protocol. Enables you to specify a computer about which you want network diagnostics information.
/STATUS
NET HELP
Loads protocol and network-adapter drivers without binding them to Protocol Manager. This command may be required if you are using a third-party network-adapter driver. You can then bind the drivers to Protocol Manager by typing NET START NETBIND.
NET LOGOFF
Breaks the connection between your computer and the shared resources to which it is connected.
NET LOGON
password
? /DOMAIN
/YES
/SAVEPW:NO
If you would rather be prompted to type your user name and password instead of specifying them in the NET LOGON command line, type NET LOGON without options.
NET PASSWORD Changes your logon password.
NET PASSWORD [oldpassword [newpassword]] NET PASSWORD \\computer | /DOMAIN:name [user [oldpassword [newpassword]]]
oldpassword newpassword Specifies your current password. Specifies your new password. It can have as many as 14 characters.
computer
Specifies the Windows NT or LAN Manager server on which you want to change your password. Specifies that you want to change your password on a Windows NT or LAN Manager domain. Name Specifies the Windows NT or LAN Manager domain on which you want to change your password. Specifies your Windows NT or LAN Manager user name.
/DOMAIN
user
The first syntax line above is for changing the password for your password-list file. The second syntax line above is for changing your password on a Windows NT or LAN Manager server or domain.
NET PRINT Displays information about print queues and controls print jobs.
NET PRINT \\computer[\printer] | port [/YES] NET PRINT \\computer | port [job# [/PAUSE | /RESUME | /DELETE]] [/YES]
computer Specifies the name of the computer whose print queue you want information about. Specifies the name of the printer you want information about. Specifies the name of the parallel (LPT) port on your computer that is connected to the printer you want information about. Specifies the number assigned to a queued print job. You can specify the below options. Pauses a print job. Restarts a print job that has been paused. Cancels a print job. Carries out the NET PRINT command without first prompting you to provide information or confirm actions.
printer port
job#
When you specify the name of a computer by using the NET PRINT command, you receive information about the print queues on each of the shared printers that are connected to the computer.
NET SEND NET SEND {name | * | /DOMAIN[:name] | /USERS} message
Sends messages to other users, computers, or messaging names on the network. The Messenger service must be running to receive messages. You can send a message only to an name that is active on the network. If the message is sent to a username, that user must be logged on and running the Messenger service
/DOMAIN[:name]Sends the message to all the names in the workstation domain. If name is specified, the message is sent to all the names in the specified domain or workgroup. /USERS message NET SHARE Sends the message to all users connected to the server. Is text to be sent as a message.
NET SHARE sharename sharename=drive:path [/USERS:number | /UNLIMITED] [/REMARK:"text"] [/CACHE:Manual | Automatic | No ] [/USERS:number | /UNLIMITED] [/REMARK:"text"] [/CACHE:Manual | Automatic | No ] /DELETE
sharename
Starts services. NOTE: Services cannot be started from a command prompt within Windows.
NET START [BASIC | NWREDIR | WORKSTATION | NETBIND | NETBEUI | NWLINK] [/LIST] [/YES] [/VERBOSE]
BASIC NWREDIR WORKSTATION NETBIND NETBEUI NWLINK /LIST /YES Starts the basic redirector. Starts the Microsoft Novell(R) compatible redirector. Starts the default redirector. Binds protocols and network-adapter drivers. Starts the NetBIOS interface. Starts the IPX/SPX-compatible interface. Displays a list of the services that are running. Carries out the NET START command without first prompting you to provide information or confirm actions. Displays information about device drivers and services as they are
/VERBOSE
loaded.
To start the workgroup redirector you selected during Setup, type NET START without options. In general, you don't need to use any of the options.
NET STOP Stops services. NOTE: Services cannot be stopped from a command prompt within Windows. NET STOP [BASIC | NWREDIR | WORKSTATION | NETBEUI | NWLINK] [/YES] NET STOP BASIC NWREDIR WORKSTATION NETBEUI NWLINK /YES Stops the basic redirector. Stops the basic redirector. Stops the Microsoft Novell(R) compatible redirector. Stops the default redirector. Stops the NetBIOS interface. Stops the IPX/SPX compatible interface. Carries out the NET STOP command without first prompting you to provide information or confirm actions.
To stop the workgroup redirector, type NET STOP without options. This breaks all your connections to shared resources and removes the NET commands from your computer's memory.
NET TIME Displays the time on or synchronizes your computer's clock with the shared clock on a Microsoft Windows for Workgroups, Windows NT, Windows 95, or NetWare time server.
/WORKGROUP
wgname
/SET
/YES
NET USE
Connects or disconnects your computer from a shared resource or displays information about your connections.
NET USE [drive: | *] [\\computer\directory [password | ?]] [/SAVEPW:NO] [/YES] [/NO] NET USE [port:] [\\computer\printer [password | ?]] [/SAVEPW:NO] [/YES] [/NO] NET USE drive: | \\computer\directory /DELETE [/YES] NET USE port: | \\computer\printer /DELETE [/YES] NET USE * /DELETE [/YES] NET USE drive: | * /HOME
drive * Specifies the drive letter you assign to a shared directory. Specifies the next available drive letter. If used with /DELETE, specifies to disconnect all of your connections. Specifies the parallel (LPT) port name you assign to a shared printer. Specifies the name of the computer sharing the resource. Specifies the name of the shared directory. Specifies the name of the shared printer. Specifies the password for the shared resource, if any. Specifies that you want to be prompted for the password of the shared resource. You don't need to use this option unless the password is optional. Specifies that the password you type should not be saved in your password-list file. You need to retype the password the next time you connect to this resource. Carries out the NET USE command without first prompting you to provide information or confirm actions. Breaks the specified connection to a shared resource. Carries out the NET USE command, responding with NO automatically when you are prompted to confirm actions. Makes a connection to your HOME directory if one is specified in your LAN Manager or Windows NT user account.
/SAVEPW:NO
/YES
/DELETE
/NO
/HOME
NET VER
Displays the type and version number of the workgroup redirector you are using.
NET VER
NET VIEW Displays a list of computers in a specified workgroup or the shared resources available on a specified computer.
/WORKGROUP
wgname
/YES
To display a list of computers in your workgroup that share resources, type NET VIEW without options. Examples net use z: \\computer\folder Map the Z: drive to the network path //computer/folder. net send mrhope "There is hope!" Send a text message to the computer with a host name of mrhope the message There is hope!. Note: This command only works for Windows versions that support this command. Note: Many computers today have also disabled the messenger service, if this service is disabled you will be unable to send/receive net send messages. Additional information about how this service is disabled can be found on document CH0000519. If you need this service enabled, follow the instructions on this page and choose to enable the service instead of disabling it. net send * "There is hope!" The above command would send There is hope! to all users in your current domain. This command should be used with caution since if you're on a school or work network many of the computers on that network if not all well be sent a message if the messenger service is enabled on the computers. net config workstation Display additional information about the network such as the computers name, workgroup, logon domain, DNS, and other useful information.
net view \\hope View the available computers and their shared resources you may use either of the below commands. The first example displays available computers. The last command would display the shared resources on the hope computer. net localgroup Display all groups currently setup on the computer you're running the command on. net share Display all network shares on your computer. net share hope=c:\hope\files Create a share called "hope" for the "c:\hope\files" directory. NETSTAT The netstat command is used to display the TCP/IP network protocol statistics and information.
See the netstat command page for further help with this MS-DOS and Windows command. See the Unix and Linux netstat command for further help with this command.
NSLOOKUP The nslookup MS-DOS utility that enables a user to do a reverse lookup on an IP address of a domain or host on a network.
See the nslookup command page for further help on this MS-DOS and Windows command. See the Unix and Linux nslookup command page for further help with this command. Linux users may also be interested in the host command that performs a similar task.
ROUTE The route MS-DOS utility enables computers to view and modify the computer's route table.
See the route command page for further information and help with this command.
TRACERT and TRACEROUTE The tracert command in MS-DOS and Windows or the traceroute command in Unix and Linux and variants is another commonly used network command to help determine network related issues or slowdowns. Using this command you can view a listing of how a network packet travels through the network and where it may fail or slow down. Using this information you can determine the computer, router, switch or other network device possibly causing your network issues. About tracert
The tracert command is used to visually see a network packet being sent and received and the amount of hops required for that packet to get to its destination. Users with Microsoft Windows 2000 and Windows XP who need additional information network latency and network loss should also consider using the pathping command. Availability The tracert.exe command is an external command that is available in the below Microsoft operating systems. MS-DOS 6.2, Windows 95, Windows 98, Windows ME, Windows NT Windows 2000, Windows XP Windows Vista, Windows 7 Syntax
tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name
Options:
-d Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target. -j host-list -w timeout Loose source route along host-list. Wait timeout milliseconds for each reply.
Examples Below is an example when we used tracert on www.computerhope.com. As you can see in the below example, we had a very short list and time to get to its destination because of the location we are. tracert computerhope.com
1169 ms190 ms160 msslc1-tc.xmission.com [166.70.1.20] 2159 ms160 ms190 mscisco0-tc.xmission.com [166.70.1.1] 3165 ms189 ms159 mswww.computerhope.com [166.70.10.23]
WHOIS The whois command available in Unix and Linux variants helps allow a user to identify a domain name. This command provides information about a domain name much like the WHOIS on network solutions. In some cases the domain information will be provided from Network Solutions. WINIPCFG
The winipcfg command available in Windows allows a user to display network and network adapter information. Here, a user can find such information as an IP address, Subnet Mask, Gateway, etc... Availability The winipcfg program is available in: Windows 95, Windows 98, Windows ME, Windows NT Windows 2000 and Windows XP do not utilize this command. Users using these operating systems will need to use the ipconfig command instead. Tip: Windows 2000, Windows XP and above users do not have winipcfg. Instead, use ipconfig.