Handy DOS commands

DOS Commands

Below are some handy dos command to help diagnose networking issues.

Quick Links
Ping Tracert Finger Nslookup Telnet Net stat SFC

 

Ping [top]
Format  ping www.domainname.com or ping xxx.xxx.xxx.xxx(x
= ip number)
Usage  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 Ping the specified host until stopped. To see statistics
and continue – type Control-Break;
To stop – type Control-C.
-a Resolve addresses to hostnames.
-n count Number of echo requests to send.
-l size Send buffer size.
-f Set Don’t Fragment flag in packet.
-i TTL Time To Live.
-v TOS Type Of Service.
-r count Record route for count hops.
-s count Timestamp for count hops.
-j host-list Loose source route along host-list.
-k host-list Strict source route along host-list.
-w timeout Timeout in milliseconds to wait for each reply.

 

 Tracert [top]
 Format  tracert www.domainname.com or tracert xxx.xxx.xxx.xxx
 Usage  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 Loose source route along host-list.
 -w timeout Wait timeout milliseconds for each reply.

 

 Finger [top]
(note: not usually implement anymore)
 Format  finger name@domain.com.au
 Usage  FINGER [-l] [user]@host […]
 Options -l Displays information in long list format.
user Specifies the user you want information about. Omit the user parameter
to display information about all users on the specified host.
@host Specifies the server on the remote system whose users you want
information about.
 Nslookup [top]
 Format  nslookup
 Usage  nslookup
 Options (identifiers are shown in uppercase, [] means optional)

NAME – print info about the host/domain NAME using default server
NAME1 NAME2 – as above, but use NAME2 as server
help or ? – print info on common commands
set OPTION – set an option
all – print options, current server and host
[no]debug – print debugging information
[no]d2 – print exhaustive debugging information
[no]defname – append domain name to each query
[no]recurse – ask for recursive answer to query
[no]search – use domain search list
[no]vc – always use a virtual circuit
domain=NAME – set default domain name to NAME
srchlist=N1[/N2/…/N6] – set domain to N1 and search list to N1,N2, etc.

root=NAME – set root server to NAME
retry=X – set number of retries to X
timeout=X – set initial time-out interval to X seconds
type=X – set query type (ex. A,ANY,CNAME,MX,NS,PTR,SOA,SRV)
querytype=X – same as type
class=X – set query class (ex. IN (Internet), ANY)
[no]msxfr – use MS fast zone transfer
ixfrver=X – current version to use in IXFR transfer request
server NAME – set default server to NAME, using current default server
lserver NAME – set default server to NAME, using initial server
finger [USER] – finger the optional NAME at the current default host
root – set current default server to the root
ls [opt] DOMAIN [> FILE] – list addresses in DOMAIN (optional: output to FILE)

-a – list canonical names and aliases
-d – list all records
-t TYPE – list records of the given type (e.g. A,CNAME,MX,NS,PTR etc.)
view FILE – sort an ‘ls’ output file and view it with pg
exit – exit the program

 

 Telnet [top]
 Format  telnet domain port
 Usage  telnet domain 25 or 110
 Options close close current connection
display display operating parameters
open connect to a site
quit exit telnet
set set options (type ‘set ?’ for a list)
status print status information
unset unset options (type ‘unset ?’ for a list)
?/help print help information

 

set options
NTLM Turn ON NTLM Authentication.
LOCAL_ECHO Turn ON LOCAL_ECHO.
TERM x (where x is ANSI, VT100, VT52, or VTNT)
CRLF Send both CR and LF
(The above commands work for all win versions)

 

Netstat [top]
 Format  
 Usage  NETSTAT [-a] [-e] [-n] [-s] [-p proto] [-r] [interval]
 Options -a Displays all connections and listening ports.
-e Displays Ethernet statistics. This may be combined with the -s option.

-n Displays addresses and port numbers in numerical form.
-p proto Shows connections for the protocol specified by proto; proto may be
TCP or UDP. If used with the -s option to display per-protocol statistics, proto
may be TCP, UDP, or IP.
-r Displays the routing table.
-s Displays per-protocol statistics. By default, statistics are shown for TCP,
UDP and IP; the -p option may be used to specify a subset of the default.

interval Redisplays selected statistics, pausing interval seconds between each
display. Press CTRL+C to stop redisplaying statistics. If omitted, netstat will
print the current configuration information once.

 

 System File Checker (SFC) [top]
 Format  
 Usage SFC [/SCANNOW] [/SCANONCE] [/SCANBOOT] [/CANCEL] [/ENABLE] [/PURGECACHE]
[/CACHE SIZE=x] [/QUIET]
 Options  /SCANNOW Scans all protected system files immediately.

/SCANONCE Scans all protected system files once at the next boot.
/SCANBOOT Scans all protected system files at every boot.
/CANCEL Cancels all pending scans of protected system files.
/QUIET Replaces all incorrect file versions without prompting the user.
/ENABLE Enables Windows File Protection for normal operation
/PURGECACHE Purges the file cache and scans all protected system files immed
iately.
/CACHESIZE=x Sets the file cache size

Leave a Reply

Your email address will not be published. Required fields are marked *