Find the answer to your Linux question:
Results 1 to 3 of 3
Dear All, I am writing a bash script to find out hostname(machine name of win xp,2000 and 98 local area net work which doesn't have dns name resolution configured) form ...
  1. #1
    Just Joined!
    Join Date
    Oct 2006
    Posts
    18

    Smile findout windows hostnames using ip address

    Dear All,

    I am writing a bash script to find out hostname(machine name of win xp,2000 and 98 local area net work which doesn't have dns name resolution configured) form ip address. I've tried ping, traceroute and other various utilities, but unable to do that.

    In windows, dos
    Code:
    ping -a <ip address>
    gives the hostname of the ip address owned by machine. But in linux, bash I've tried, couldn't found in man pages.
    Is there any compatible command for that to accomplish my goal?

    Is there any way to read header of the ip packet and get any information related to hostname after ping to that ip address?

    Or any good way of doing that?

    Pls help me to solve this problem in bash?

    Thanks,

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Smile

    try nslookup:
    nslookup <ipaddr>

    is that useful?
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  3. #3
    Just Joined!
    Join Date
    Dec 2007
    Posts
    2
    Hello,

    if DNS is not configured in the network, samba command nmblookup may help:

    nmblookup - NetBIOS over TCP/IP client used to lookup NetBIOS names

    nmblookup

    for example:
    nmblookup -A 10.10.10.1

    hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...