Saturday, May 22, 2010

hostname and ip - demystified :)


Never involved in hardcore network programming after my academics., but recently found this tweak really handy sometimes., its trivial once u realize what it is :)


Majority of corporates have M$ Windows domain running and at least, i sometimes wanted to know either windows machine's host-name or  ip-address, given the other one. so.,


  • IPAddress to HostName
    just try trace route command

    >tracert
    169.24.137.123 
    Tracing route to  labpc004148.apr.dhcp.ht.com [169.24.137.123] 
    over a maximum of 30 hops:
    1  <1 ms    <1 ms    <1 ms  [169.24.182.1]
    2  <1 ms    <1 ms    <1 ms  jsr21-vlan299.itg.ti.com [169.24.253.34]
     
    <1 ms    <1 ms    <1 ms  labpc004148.apr.dhcp.dt.com [169.24.137.123]

  • HostName to IPAddressjust ping the hostname, :) it will resolve into ip-address

    >ping labpc004148
    Pinging labpc004148 [169.24.137.123] with 32 bytes of data:

    Reply from
    169.24.137.123: bytes=32 time<1ms TTL=126
    Reply from
    169.24.137.123: bytes=32 time<1ms TTL=126
    Reply from
    169.24.137.123: bytes=32 time<1ms TTL=126
    Reply from
    169.24.137.123: bytes=32 time<1ms TTL=126

    Ping statistics for
    169.24.137.123:
        Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
        Minimum = 0ms, Maximum = 0ms, Average = 0ms

No comments:

 
Copyright 2009 dev.blog. Powered by Blogger. Statistics