Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
I have a few servers on my network, and I was wondering if there was a way to "find" them (by IP). I basically dont want to have to hook ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2004
    Location
    SLC, UT
    Posts
    67

    Finding the IPs of other machines on my network


    I have a few servers on my network, and I was wondering if there was a way to "find" them (by IP).

    I basically dont want to have to hook up my monitor to remember what the IP is.

    BTW - I am doing this from command (terminal)

    Thanks!

  2. #2
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Buenos Aires, Argentina
    Posts
    908
    How about this:
    Code:
    root@insitt:~# nmap -sP 198.162.0.*
    
    Starting nmap 3.81 ( http://www.insecure.org/nmap/ ) at 2005-04-21 13:36 ART
    Host insitt (198.162.0.1) appears to be up.
    Host serzb0x (198.162.0.2) appears to be up.
    MAC Address: 00:0C:6E:49:3A:05 (Asustek Computer)
    Host zeol (198.162.0.3) appears to be up.
    MAC Address: 00:80:AD:05:42:CD (Cnet Technology)
    Host daniel (198.162.0.8) appears to be up.
    MAC Address: 00:0E:A6:B6:98:CD (Asustek Computer)
    Nmap finished: 256 IP addresses (4 hosts up) scanned in 8.991 seconds
    serzsite.com.ar
    "All the drugs in this world won\'t save you from yourself"

  3. #3
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    i knew bout that command. and have used it myself in future.... but how do u get it to show the host names?? I have never worked out why it doesn't!
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Buenos Aires, Argentina
    Posts
    908
    You have to add them to your /etc/hosts file.
    serzsite.com.ar
    "All the drugs in this world won\'t save you from yourself"

  6. #5
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    well, i dont have the ip of all the computers on the network, but it doesn't show the ones that i do have in that file :s
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  7. #6
    Linux Newbie
    Join Date
    Sep 2003
    Location
    St.Charles, Missouri, USA
    Posts
    201
    ping -b <a>.[b].<c>.255
    Powered by Gentoo
    never ever ever use the hardened option in make.conf!

  8. #7
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Buenos Aires, Argentina
    Posts
    908
    Quote Originally Posted by sdousley
    well, i dont have the ip of all the computers on the network, but it doesn't show the ones that i do have in that file :s
    How are you running the command and how does your /etc/hosts file look like?

    nmap will "ping scan" what you tell it, if in the scan there's an ip that matches with an ip in /etc/hosts then it will show its hostname near its ip.

    Do I explain myself?
    serzsite.com.ar
    "All the drugs in this world won\'t save you from yourself"

  9. #8
    Linux User
    Join Date
    Oct 2004
    Location
    Serbia&Montenegro
    Posts
    281
    Nmap is probably the best way to do this. I tried that myself.
    Linux registered user #358842
    Human knowledge belongs to the world.

  10. #9
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    my /etc/hosts:
    Code:
    127.0.0.1       localhost
    192.168.2.9     homer
    192.168.0.1     jebediah
    and when i run nmap -sP 192.168.0.0/24 i get:
    Code:
    homer root # nmap -sP 192.168.0.0/24
    
    Starting nmap 3.75 &#40; http&#58;//www.insecure.org/nmap/ &#41; at 2005-04-22 13&#58;34 BST
    Host jebediah &#40;192.168.0.1&#41; appears to be up.
    MAC Address&#58; 00&#58;01&#58;02&#58;0C&#58;CF&#58;02 &#40;3com&#41;
    Host 192.168.0.4 appears to be up.
    MAC Address&#58; 00&#58;40&#58;D0&#58;47&#58;9E&#58;FA &#40;Mitac International&#41;
    Host 192.168.0.9 appears to be up.
    Nmap run completed -- 256 IP addresses &#40;3 hosts up&#41; scanned in 5.753 seconds
    homer root #
    See it doesn't show the ip for homer? (the computer i'm running it from)
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  11. #10
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Buenos Aires, Argentina
    Posts
    908
    In your /etc/hosts file, It's 192.168.0.9, not 192.168.2.9.
    serzsite.com.ar
    "All the drugs in this world won\'t save you from yourself"

Page 1 of 2 1 2 LastLast

Posting Permissions

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