Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there a program which can tell me the ip address of a computer when is connected to my network? A list of names or ip addresses.

For example when my wife is on my main desktop computer I can either go on another desktop or laptop and work. However I don't know the ip address of the computer she's on it's dhcp and no static ip addresses. I would like to ssh into the main desktop and work on it. Sometimes I have asked her if I could get on for a minute to get the ip address. From a terminal I do an ifconfig and get the address. I could get it from the router too but that is requires logging into the router. There must be some short command I can run? All the computers are running Ubuntu and samba is not installed. Once I know the ip address I can ssh into the main desktop.

share|improve this question
    
Try nmap and arp-scan as suggested here and here. –  Peachy Oct 6 '12 at 18:44
    
Possible duplicate of: How to see all computers connected to a network. –  Peachy Oct 6 '12 at 18:46
    
You can configure the router to it gave permanent IP's based on MAC-address of network card of your computers. –  martini Oct 6 '12 at 19:27
    
@msPeachy I installed avahi-discover and nmap and tried them. I will install arp-scan and try it. As far as the possible duplicate. I think that post they give the ip address and nothing more. Nmap is suggested but doesn't give any means to get what he wanted The below answers and yours were very useful to get the name of the computer and ip address. Thank you for helping. –  Timothy Oct 7 '12 at 3:54
    
@martini I could configure the router to do this. I thought about it at one point and just never got around to do it. It doesn't happen often but avahi-discover,nmap or arp-scan will work. Thank you for suggesting it. –  Timothy Oct 7 '12 at 3:59

4 Answers 4

you could try nmap, if you don't have it, it can be installed via the following :-

sudo apt-get install nmap

you can then scan your network by issuing :-

nmap -sP 192.168.1.0/24

obviously change address range if your network differs

share|improve this answer
    
Nice answer here. –  John S Gruber Oct 7 '12 at 3:34
1  
Thank you, I installed nmap and tried it works. Does alot Just was reading about nmap in wikipedia. Powerful stuff. –  Timothy Oct 7 '12 at 3:38

Modern releases of Ubuntu use avahi, so one could also use avahi-discover

sudo apt-get install avahi-discover

and run with:

avahi-discover

this allows you to view all the machines on the network and see the IP address, MAC address and services running on these machines.

Alternatively one could use:

avahi-browse -rat
share|improve this answer
    
Thank you, I never knew about this command. I installed it and I like it. It gives you a lot of information. Very useful. –  Timothy Oct 7 '12 at 3:31

Just as apacheuk mentionned, using nmap is a great and efficient way. Actually the -O option enables you to get additional informations such as the MAC address, the open ports, the OS type, the distance (in hops):

nmap -O 192.168.1.0/24

Please note that you main need to be logged in as root or sudo in order to be able to do that.

share|improve this answer

You can login to your router and look at the connected devices list
Here is another way :
You can login using the computer name of the client
So run cat /etc/hostname on your wifes computer, you may get something like wife-System-Product-Name if that is the case you can run ssh wife@wife-System-Product-Name.local and login without using the ip address, that address only changes if you edit the /etc/hostname and /etc/hosts files or do a reinstall and give the system a new name

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.