How to know " Window's machine IP address and hostname " from ubuntu in the same network ?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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".
Distribution: Primarily Deb/Ubuntu, and some CentOS
Posts: 826
Rep:
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.
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.
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.
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.
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.
...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.
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.
...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 )
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.