Application level commands

NET VIEW
[\\computername [/CACHE] | [/ALL] | /DOMAIN[:domainname]]
NET VIEW displays a list of resources being shared on a computer.
When used without options, it displays a list of computers in the current domain or network.

\\computername                       Is a computer whose shared resources you want to view
/DOMAIN:domainname         Specifies the domain for which you want to view
                                                the available computers. If domainname is omitted, displays all domains in the local area network.
/CACHE                                 Displays the offline client caching settings for the resources on the specified computer
/ALL                                       Displays all the shares including the $ shares
The "$" appended to the end of the share name means that it is a hidden share.
Windows will not list such shares among those it defines in typical queries by remote clients
to obtain the list of shares. One needs to know the name of an administrative share in order
to access it. Not every hidden share is administrative share; in other words,
ordinary hidden shares may be created at user's discretion.

net view returns the computers in the current domain or network.
This list will only show computers that have file and printer sharing enabled.
net view /all shows all shares available, including administrative shares like C$ and admin$
net view /domain:ntt-group.org will list all of the sharing computers in the ntt-group.org domain

Session level commands

nbtstat is designed to help troubleshoot NetBIOS name resolution problems.
When a network is functioning normally, NetBIOS over TCP/IP (NetBT) resolves NetBIOS names to IP addresses.
nbtstat -c shows the contents of the NetBIOS name cache, which contains NetBIOS name-to-IP address mappings.
nbtstat -n displays the names that have been registered locally on the system by NetBIOS applications,
        such as the server and redirector.
n btstat -r displays the count of all NetBIOS names resolved by broadcast and by querying
        a WINS server.
nbtstat -rr sends name release packets to the WINS server and starts a refresh,
        thus re-registering all names with the name server without having to reboot.
nbtstat -s list the current NetBIOS sessions and their status, including statistics

Transport level commands

NETSTAT Displays active TCP connections, ports on which the computer is listening, Ethernet statistics,
the IP routing table, IPv4 statistics (for the IP, ICMP, TCP, and UDP protocols).

NETSTAT provides statistics for the following:

Proto - The name of the protocol (TCP or UDP).

Local Address - The IP address of the local computer and the port number being used.
The name of the local computer that corresponds to the IP address and the name of the port is
shown unless the -n parameter is specified.
An asterisk (*) is shown for the host if the server is listening on all interfaces.
If the port is not yet established, the port number is shown as an asterisk.

Foreign Address - The IP address and port number of the remote computer to which the socket
is connected. The names that corresponds to the IP address and the port are shown unless the -n
parameter is specified. If the port is not yet established, the port number is shown as an
asterisk (*).

State - Indicates the state of a TCP connection. The possible states are as follows:
CLOSE_WAIT, CLOSED, ESTABLISHED, FIN_WAIT_1, FIN_WAIT_2, LAST_ACK, LISTEN, SYN_RECEIVED, SYN_SEND, and TIME_WAIT.

netstat -a Displays all active TCP connections and the TCP and UDP ports on which the computer is listening.
netstat -e Displays Ethernet statistics, such as the number of bytes and packets sent and received.
        This parameter can be combined with –s.
netstat -n Displays active TCP connections, however, addresses and port numbers are expressed
        numerically and no attempt is made to determine names.
netstat -o Displays active TCP connections and includes the process ID (PID) for each connection.
        You can find the application based on the PID on the Processes tab in Windows Task Manager.
        This parameter can be combined with -a, -n, and -p.
netstat -p Shows connections for the protocol specified by Protocol.
        In this case, the Protocol can be tcp, udp, tcpv6, or udpv6.
        If this parameter is used with -s to display statistics by protocol,
        Protocol can be tcp, udp, icmp, ip, tcpv6, udpv6, icmpv6, or ipv6.
netstat -r Displays the contents of the IP routing table. This is equivalent to the route print command
netstat -s Displays statistics by protocol. By default, statistics are shown for the TCP, UDP,
       ICMP, and IP protocols. If the IPv6 protocol for Windows XP is installed, statistics are shown for
       the TCP over IPv6, UDP over IPv6, ICMPv6, and IPv6 protocols.
       The -p parameter can be used to specify a set of protocols.
netstat Re-displays the selected information every Interval seconds.
       Press CTRL+C to stop the redisplay. If this parameter is omitted, netstat prints the selected information only once

Network level commands

nslookup (domain name)
Returns the IP address of the domain queried
If the answer doesn't come straight from the root domain name server is will report as a "Non-authoritative answer"

nslookup (IP address)
Returns the domain name associated with an IP address
Often the domain returned is from a cache server such as one from Akamai

Entering nslookup with no trailing arguement opens the nslookup application
? gives list of nslookup commands
exit closes the application

ipconfig/flushdns
Flushes the DNS resolver cache
Try if the computer is having problems resolving DNS addresses

arp -a
To check if the DHCP server is handing out wrong DNS server information
dynamic listing means that address was handed out by a DHCP server

To change IP settings on a NIC, such as DNS server, and DHCP settings, etc
open the Network Control Panel (ncpa.cpl via start or command prompt)
Double-click on the NIC to change
        If wireless NIC click on proprerties
Double click Internet Protocol Version 4 from the list
You can now select DHCP and DNS server settings
If you select the advanced button there are additional settings for those two parameters
along with NetBIOS settings.

Data-Link level commands

Often, it is helpful to be able to change the order in which a computer uses and lists its available NIC cards.
To change the NIC Binding Order:
1.    Click Start, click Run, type ncpa.cpl and then click OK,
or open the control panel and select Network Connections.
You can see the available connections in the LAN and High-Speed
Internet section of the Network Connections window.
2.     On the Advanced menu, click Advanced Settings, and then
click the Adapters and Bindings tab.
3.     In the Connections area, select the connection that you want to move
higher in the list. Use the arrow buttons to move the connection.
You can also open the Network Connections Panel by entering ncpa.cpl from the command line

To access NIC properties open the Network Connections Panel as shown above and double-click
on the desired NIC.

To see if the NIC is working, ping 127.0.0.1 or ping localhost.
"PING" = "Packet InterNet Groper"
Ping operates by sending Internet Control Message Protocol (ICMP) echo request packets to the
target host and waiting for an ICMP echo reply.

Troubleshooting checklist

1.    To see if the NIC is working, ping 127.0.0.1 or ping localhost.
2.    To determine your computer’s IP address and gateway type “ipconfig”.
3.    Ping some local machines using their IP addresses and DNS name.
4.    Use “net view” to see local area network systems.
5.    Make sure that the net mask is correct by entering “ipconfig”.
6.    Try renewing the DHCP lease by entering “ipconfig /renew all”.
7.    Determine your computer’s name by going to Start and Run and enter “msconfig”
8.    Select the “Tools” tab and then “System Information” and the “Launch” button.
9.    Typing “hostname” on the command line will also give you the computer’s name.
10.    Run netstat which will show current network connections to your system.
11.    Run netstat –s which will show you network statistics.
        This is good for seeing if you are sending and not receiving or vice versa.
12.    If you can’t get to the internet, see if you can ping the router.
        The router has two interfaces: one to the local net and one facing the internet.
        If you can’t ping the far side of the router, then something is wrong with the router.
13.    Use tracert to trace route over the internet to a location on the internet.
        Tracert is a Windows command prompt (Microsoft version of Traceroute).
        Enter tracert (DNS name or IP address)
        You can also use PathPing which is a route tracing tool that combines
        features of Ping and Tracert with additional information that neither of those tools provides.
        PathPing sends packets to each router on the way to a final destination over a period of time, and
        then computes results based on the packets returned from each hop.
        Since PathPing shows the degree of packet loss at any given router or link, you can pinpoint
        which routers or links might be causing network problems.