LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to know " Window's machine IP address and hostname " from ubuntu in the same network ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-know-windows-machine-ip-address-and-hostname-from-ubuntu-in-the-same-network-4175594433/)

manashpal 11-29-2016 08:48 AM

How to know " Window's machine IP address and hostname " from ubuntu in the same network ?
 
hello friends,

recently I am looking for a fix on the following problem :

* I wanted to know my windows machine's IP address ( which I have got by using arp-scan <IP address range starting from 0>/20. I got the output as its ip address and the mac id. but , it was not what I was looking for. I wanted to know its hostname alongwith IP address. but, it comes up only with ip and mac id.

so, naturally its a stuck to my curiosity, I know my expert friends can easily do it, but want to know how ? pls, let me know about it.

AwesomeMachine 11-29-2016 08:57 AM

Try fing: https://www.fing.io/download-free-ip...ndows-and-osx/

TB0ne 11-29-2016 09:32 AM

Quote:

Originally Posted by manashpal (Post 5635821)
hello friends,
recently I am looking for a fix on the following problem :

* I wanted to know my windows machine's IP address ( which I have got by using arp-scan <IP address range starting from 0>/20. I got the output as its ip address and the mac id. but , it was not what I was looking for. I wanted to know its hostname alongwith IP address. but, it comes up only with ip and mac id.

so, naturally its a stuck to my curiosity, I know my expert friends can easily do it, but want to know how ? pls, let me know about it.

We let you know BEFORE...did you not read/understand that thread??
http://www.linuxquestions.org/questi...rk-4175593904/

If you want to know the host name, that's what DNS is for...do those machines have entries? If not, then you have two choices: enter them into your local network's DNS server, or put them in the machines hosts file.

And don't use text-speak..it's "please" not "pls".

erik2282 11-29-2016 09:46 AM

Also, in that thread TB0ne linked to, Turbocapitalist suggested nmap and its gui-frontend zenmap, which is a very cool tool, imo. Have you tried it yet? nmap is an awesome tool for this kind of stuff. I'll do hand-holding here. Try this command:

Code:

root@computer:~# nmap -sn 192.168.0.0/24
Of course, use your network address in place of my example one.

manashpal 12-06-2016 08:31 AM

user name of the windows machine from linux
 
Quote:

Originally Posted by TB0ne (Post 5635838)
We let you know BEFORE...did you not read/understand that thread??
http://www.linuxquestions.org/questi...rk-4175593904/

If you want to know the host name, that's what DNS is for...do those machines have entries? If not, then you have two choices: enter them into your local network's DNS server, or put them in the machines hosts file.

And don't use text-speak..it's "please" not "pls".


I think I was unable to clear my question. suppose, my six linux machines are on same network. I used angry ip, and it gave me the user name alongwith IP address. but, now, If a windows machine is on the same network, then what to do ? ANGRYIP scanner is found unable to scan the username of that windows machine. but, I need to know the user name of that windows machine, now tell me, what steps should I follow ?
thanks in advance.

TB0ne 12-06-2016 09:25 AM

Quote:

Originally Posted by manashpal (Post 5638620)
I think I was unable to clear my question. suppose, my six linux machines are on same network. I used angry ip, and it gave me the user name alongwith IP address. but, now, If a windows machine is on the same network, then what to do ? ANGRYIP scanner is found unable to scan the username of that windows machine. but, I need to know the user name of that windows machine, now tell me, what steps should I follow?

Again, you were told in your other thread. Did you bother to try nmap/zenmap? Did you set the host names in DNS? Did you perform the actions needed for DHCP hosts/addresses, as you were told before????

AGAIN...what you described in your other thread wasn't clear, and you were asked for details, and didn't provide them. Unless the hosts names are set via DHCP and/or via DNS, there will BE no host name to return. Either set up your Windows machines to set these things accordingly, set up a DNS server and enter them, or set up DHCP to set up the host names. No other choices...pick one.

Madhu Desai 12-06-2016 09:41 AM

You will get the hostname of Windows machine in lan network by this command assuming your network address is 192.168.1.0/24. Replace range with your own subnet.
Code:

sudo nbtscan -r 192.168.1.0/24

TB0ne 12-06-2016 10:24 AM

Quote:

Originally Posted by mddnix (Post 5638652)
You will get the hostname of Windows machine in lan network by this command assuming your network address is 192.168.1.0/24. Replace range with your own subnet.
Code:

sudo nbtscan -r 192.168.1.0/24

...except that nbtscan isn't loaded on most distros, and will have to be downloaded/installed/compiled before such a command will work. Also, the last release was over TEN YEARS AGO, so this tool is fairly old. And, netbios was deprecated long ago, in favor of DNS. While you can ENABLE netbios/WINS on Windows, it may be turned off by default...so this tool wouldn't even work in such cases.

Madhu Desai 12-06-2016 10:43 AM

Quote:

Originally Posted by TB0ne (Post 5638678)
...except that nbtscan isn't loaded on most distros, and will have to be downloaded/installed/compiled before such a command will work. Also, the last release was over TEN YEARS AGO, so this tool is fairly old. And, netbios was deprecated long ago, in favor of DNS. While you can ENABLE netbios/WINS on Windows, it may be turned off by default...so this tool wouldn't even work in such cases.

You are right, but still its a handy tool for low level scanning for PC/Laptops with windows OS in LAN, when they get IP address from dhcp. I have installed several Windows 7/10 Pro recently, and I am pretty sure I haven't enabled netbios by myself anywhere. So maybe netbios is enabled by default for compatibility reason. Computer name gets trimmed to first 15 characters for netbios though.

TB0ne 12-06-2016 03:53 PM

Quote:

Originally Posted by mddnix (Post 5638685)
You are right, but still its a handy tool for low level scanning for PC/Laptops with windows OS in LAN, when they get IP address from dhcp. I have installed several Windows 7/10 Pro recently, and I am pretty sure I haven't enabled netbios by myself anywhere. So maybe netbios is enabled by default for compatibility reason. Computer name gets trimmed to first 15 characters for netbios though.

Sorry, but if DHCP is correctly configured, it will work with DNS on your network to get things advertised. Using a tool that's more than ten years old, that only supports something that not even MICROSOFT is using widely anymore, doesn't seem too good.

Yes, netbios may be turned on by default, but again, you mention how broken it is, by saying it truncates the hostname. Turning it off and using the modern standards is better than trying to use old junk.

manashpal 12-10-2016 03:27 AM

thanks, it works !
 
Quote:

Originally Posted by TB0ne (Post 5638678)
...except that nbtscan isn't loaded on most distros, and will have to be downloaded/installed/compiled before such a command will work. Also, the last release was over TEN YEARS AGO, so this tool is fairly old. And, netbios was deprecated long ago, in favor of DNS. While you can ENABLE netbios/WINS on Windows, it may be turned off by default...so this tool wouldn't even work in such cases.


yes, it was turned off by default, after enabling it, windows machine is under listing, but with the following command:

sudo nbtscan 192.168.1.0/....., without ==> ( -r )

thank you sir.


All times are GMT -5. The time now is 01:03 PM.