LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 07-05-2008, 04:47 PM   #1
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Rep: Reputation: 49
Getting the hostname from a Linux computer on a LAN


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.
 
Old 07-05-2008, 05:29 PM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 57
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.
 
Old 07-05-2008, 05:53 PM   #3
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by Mr. C. View Post
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!
 
Old 07-05-2008, 08:22 PM   #4
Matir
Moderator
 
Registered: Nov 2004
Location: Kennesaw, GA
Distribution: Ubuntu
Posts: 8,502

Rep: Reputation: 110Reputation: 110
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.
 
Old 07-09-2008, 08:36 PM   #5
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Original Poster
Rep: Reputation: 49
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
one computer affects DHCP for other computer on same LAN? discomurder Linux - Networking 1 12-12-2006 03:15 AM
Ping a computer in LAN using hostname seven Linux - Networking 3 07-05-2003 10:42 PM
Hostname/computer name Brad3d Linux - General 1 01-12-2003 02:02 PM
Hostname of computer Kaiser_Sose Linux - Networking 2 02-04-2002 05:45 PM
Hostname of computer Kaiser_Sose Linux - Software 3 01-26-2002 08:22 PM


All times are GMT -5. The time now is 10:56 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration