LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 11-29-2016, 08:48 AM   #1
manashpal
LQ Newbie
 
Registered: Nov 2016
Posts: 15

Rep: Reputation: Disabled
Smile 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.
 
Old 11-29-2016, 08:57 AM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Try fing: https://www.fing.io/download-free-ip...ndows-and-osx/
 
Old 11-29-2016, 09:32 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by manashpal View Post
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".
 
1 members found this post helpful.
Old 11-29-2016, 09:46 AM   #4
erik2282
Member
 
Registered: May 2011
Location: Texas
Distribution: Primarily Deb/Ubuntu, and some CentOS
Posts: 829

Rep: Reputation: 229Reputation: 229Reputation: 229
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.
 
Old 12-06-2016, 08:31 AM   #5
manashpal
LQ Newbie
 
Registered: Nov 2016
Posts: 15

Original Poster
Rep: Reputation: Disabled
user name of the windows machine from linux

Quote:
Originally Posted by TB0ne View Post
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.
 
Old 12-06-2016, 09:25 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by manashpal View Post
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.
 
Old 12-06-2016, 09:41 AM   #7
Madhu Desai
Member
 
Registered: Mar 2013
Distribution: Rocky, Fedora, Ubuntu
Posts: 541

Rep: Reputation: 153Reputation: 153
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
 
Old 12-06-2016, 10:24 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by mddnix View Post
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.
 
Old 12-06-2016, 10:43 AM   #9
Madhu Desai
Member
 
Registered: Mar 2013
Distribution: Rocky, Fedora, Ubuntu
Posts: 541

Rep: Reputation: 153Reputation: 153
Quote:
Originally Posted by TB0ne View Post
...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.
 
Old 12-06-2016, 03:53 PM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by mddnix View Post
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.
 
Old 12-10-2016, 03:27 AM   #11
manashpal
LQ Newbie
 
Registered: Nov 2016
Posts: 15

Original Poster
Rep: Reputation: Disabled
thanks, it works !

Quote:
Originally Posted by TB0ne View Post
...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.
 
  


Reply

Tags
network



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "Clunky" or "Choppy" Window Scrolling when using scroll wheel in Ubuntu 12.04 Banquo Linux - Desktop 9 02-21-2014 07:18 PM
Hostname defined in file "network" changes after change to file "hosts" qwkfish Linux - Networking 2 10-14-2009 04:07 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM
Is it possible to "puch" a window in X to another machine????? piggyaugu Linux - Newbie 2 05-27-2005 06:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration