CompTIA A+ Core 2
Windows commands for A+ Core 2: ipconfig, netstat, nslookup, dir
ipconfig shows and refreshes the PC's IP and DNS settings, ping tests reachability, tracert lists the routers on the path, netstat lists connections and listening ports, and nslookup queries DNS. net use maps a drive letter to a share, cd changes folder, and dir lists files. Most questions turn on one switch, such as ipconfig /displaydns, netstat -o or dir /s.
ipconfig and the DNS cache
Without parameters, ipconfig shows the IPv4 and IPv6 addresses, subnet mask and default gateway for each adapter. ipconfig /all shows the full TCP/IP configuration.
ipconfig /release and ipconfig /renew give up and renew a DHCP address. They work only on adapters set to obtain an address automatically.
ipconfig /displaydns shows the DNS client resolver cache: entries preloaded from the local Hosts file plus recently resolved names. Windows checks this cache before asking its DNS servers, so it shows the address the PC is actually using. ipconfig /flushdns empties the cache so the next lookup goes to the DNS server again. Look before you flush if you need the evidence.
ping, tracert and nslookup
ping sends ICMP echo Requests and shows each reply with its round-trip time. It sends 4 by default; /n changes the count and /t keeps going until stopped.
tracert sends echo Requests with a TTL that starts at 1 and rises by one, so each router on the path answers in turn, up to 30 hops by default. A router that does not answer within the timeout shows as an asterisk.
nslookup displays information used to diagnose DNS. If a server works by IP address but not by name, nslookup is the tool for checking how DNS resolves that name.
netstat: who is connected
netstat -a lists all active TCP connections and the TCP and UDP ports the computer is listening on. -n shows addresses and ports as numbers without name lookups.
netstat -o adds the process ID (PID) that owns each connection. Match that PID on the Processes tab in Task Manager to find the application. netstat -b shows the executable directly.
net use, cd and dir
net use M: \\server\share maps a drive letter (D: through Z:) to a shared folder. /persistent:yes restores the mapping at next sign-in, and /delete removes it.
cd .. moves up to the parent folder. cd on its own shows the current drive and folder.
dir lists the files and subfolders in a folder. dir name /s lists every occurrence of that file name in the folder and all its subfolders, which is how you find a file when you do not know where it was saved. /p pauses after each screen, and /a includes files with given attributes such as hidden.
Where the exam catches people
- Believing ipconfig /flushdns shows which address is cached: it empties the cache; ipconfig /displaydns shows it.
- Believing ipconfig /renew fixes a stale name lookup: it renews the DHCP address, while a wrong cached DNS entry needs /flushdns.
- Believing netstat names the program behind a PID: -o gives the PID, and Task Manager's Processes tab (or netstat -b) maps it to the program.
- Believing dir searches subfolders by default: it lists one folder unless you add /s.
- Believing an asterisk in tracert means the destination is down: it means that hop did not reply before the timeout.