Monday, August 29, 2011

Unix Network Commands for Developers

I recently was working with a partner company where we have make few connections to their servers. These few utilities that I am listing down, helped me a lot while debugging network, connection issues.

So, here I am sharing basic + advanced utilities that i used -

###########################################################

Finding host/domain name

hostname

###########################################################

Test network connection

ping

It sends packets of information to the user-defined source. If the packets are received, the destination device sends packets back. Ping can be used for two purposes

1. To ensure that a network connection can be established.
2. Timing information as to the speed of the connection.

###########################################################

Network configuration

ifconfig

###########################################################

Connections to and from the host

netstat

netstat -a will display all connections including TCP  and UDP  
netstat –t will display only TCP  connection
netstat –u will display only UDP  connection

###########################################################

DNS lookup name - ip address to hostname, hostname to ip

nslookup

nslookup blogger.com

###########################################################

Communicate with other hostname on specific port

telnet

telnet hostname port   will telnet hostname with the port specified. Normally it is used to see whether host is alive and network connection is fine or not.

###########################################################

view current user's information - user’s login name, real name, terminal name and write status.

finger

###########################################################

Outing steps that packets take to get to network host - hop by hop, starting from your home router to inter provider's servers to ... actual host.

traceroute

traceroute http://realestate.aol.com/homes-for-sale-listings/Austin_TX
traceroute: Warning: http://realestate.aol.com/homes-for-sale-listings/Austin_TX has multiple addresses; using 8.15.7.117
traceroute to http://realestate.aol.com/homes-for-sale-listings/austin_tx (8.15.7.117), 64 hops max, 52 byte packets
 1  wireless_broadband_router (192.168.1.1)  0.801 ms  0.696 ms  0.577 ms
 2  l100.clppva-vfttp-15.verizon-gni.net (173.71.222.1)  11.506 ms  19.462 ms  11.094 ms
 3  g9-2-115.clppva-lcr-01.verizon-gni.net (130.81.129.38)  11.722 ms  11.892 ms  9.686 ms
 4  p13-0-0.clppva-lcr-02.verizon-gni.net (130.81.23.0)  154.065 ms  77.945 ms  28.307 ms
 5  so-10-0-0-0.res-bb-rtr2.verizon-gni.net (130.81.28.14)  15.989 ms  14.192 ms  9.498 ms
 6  0.ae2.br2.iad8.alter.net (152.63.34.73)  65.482 ms
    0.ae2.br1.iad8.alter.net (152.63.32.158)  21.324 ms  21.618 ms
 7  * * *
 8  vlan51.ebr1.washington12.level3.net (4.69.146.190)  18.748 ms  15.170 ms  9.677 ms
 9  ae-8-8.ebr1.washington1.level3.net (4.69.143.217)  16.840 ms  21.552 ms  19.912 ms
10  ae-91-91.csw4.washington1.level3.net (4.69.134.142)  19.294 ms  22.256 ms
    ae-61-61.csw1.washington1.level3.net (4.69.134.130)  12.568 ms
11  ae-44-90.car4.washington1.level3.net (4.69.149.198)  23.055 ms
    ae-34-80.car4.washington1.level3.net (4.69.149.134)  13.068 ms
    ae-24-70.car4.washington1.level3.net (4.69.149.70)  18.771 ms
12  co-location.car4.washington1.level3.net (4.79.170.254)  20.788 ms  21.715 ms  18.423 ms
13  64.158.56.34 (64.158.56.34)  13.092 ms  20.214 ms  9.067 ms

###########################################################

No comments:

Post a Comment