Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
 |
07-05-2008, 04:47 PM
|
#1
|
|
LQ Newbie
Registered: May 2008
Posts: 29
|
Getting the hostname from a Linux computer on a LAN
[ Log in to get rid of this advertisement]
Background: If I go into my router's setup, I can see which computers are currently using the LAN, and it also gives their hostnames.
So if I am a computer on the LAN, how can I get the hostnames of other computers on the LAN? For Windows machines, I know that I can usually use a NetBIOS query to their computer to get the hostname, unless they have taken specific measures to disable it. For a Linux machine, is there a similar way to ask it for its hostname from another computer on the LAN? And if so, how would I disable it?
And in case someone knows, for the specific case of using the WLAN with my router, when my computer first connects to the router and gives the router my computer's hostname, would someone who is sniffing packets "promiscuously" be able to get that information even if I'm using WPA/WPA2? In other words, does my computer give that information to the router before or after the encryption begins?
Thanks for any help or insight.
|
|
|
|
07-05-2008, 05:29 PM
|
#2
|
|
Senior Member
Registered: Jun 2008
Posts: 1,931
|
There are no native broadcast discovery services in traditional *nix networking. Names are discovered by doing IP->hostname lookups, either in /etc/hosts, or via DNS.
With Samba, one can emulate Windows networking, and thereby gain its discovery services.
I do not believe sensitive information is sent into the ether before the encrypted handshake is complete. A host name is hardly sensitive in any case.
|
|
|
|
07-05-2008, 05:53 PM
|
#3
|
|
LQ Newbie
Registered: May 2008
Posts: 29
|
Quote:
Originally Posted by Mr. C.
There are no native broadcast discovery services in traditional *nix networking. Names are discovered by doing IP->hostname lookups, either in /etc/hosts, or via DNS.
With Samba, one can emulate Windows networking, and thereby gain its discovery services.
I do not believe sensitive information is sent into the ether before the encrypted handshake is complete. A host name is hardly sensitive in any case.
|
Yes, I totally agree that "a host name is hardly sensitive in any case", I mainly wanted to know this for my own information. Often people name their computers in ways that obviously identify them, so it's a step in the right direction if you can keep that information hidden from would-be hackers on a LAN; that way they have a harder time figuring out which LAN IP actually corresponds to which computer. Thanks for the info!
|
|
|
|
07-05-2008, 08:22 PM
|
#4
|
|
Moderator
Registered: Nov 2004
Location: Atlanta, GA
Distribution: Ubuntu
Posts: 8,027
|
It's not usually easy to enumerate all of the hosts and hostnames on a network unless they are registered in DNS. Your router has this information because, most likely, it is acting as a DHCP server, and systems send their hostname in their DHCP requests.
To answer the second part of your question: WPA/WEP encryption is applied to each packet that is sent. Only a hardware handshake is performed before the encryption. Hostname information is in the DHCP request, which is in a standard data packet.
|
|
|
|
07-09-2008, 08:36 PM
|
#5
|
|
LQ Newbie
Registered: May 2008
Posts: 29
|
Matir, thanks for the info about the host name being given with a DHCP request; I tested it with my router--I connected to my router with a static IP and sure enough, no longer was my host name listed in the router config (whereas the router lists my computer's name when I use DHCP). I'm starting to understand it all better now, thanks for the help. 
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:11 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
LQ Podcast
LQ Radio
|
|