LinuxQuestions.org
Visit Jeremy's Blog.

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 access 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.

Are you new to LinuxQuestions.org? Visit the following links:
Site Howto | Site FAQ | Sitemap | Register Now

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.

Go Back   LinuxQuestions.org > Forums > Linux > 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.

Reply
 
Thread Tools
Old 07-05-2008, 04:47 PM   #1
CJS
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.
CJS is offline     Reply With Quote
Old 07-05-2008, 05:29 PM   #2
Mr. C.
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.
Mr. C. is offline     Reply With Quote
Old 07-05-2008, 05:53 PM   #3
CJS
LQ Newbie
 
Registered: May 2008
Posts: 29
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!
CJS is offline     Reply With Quote
Old 07-05-2008, 08:22 PM   #4
Matir
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.
Matir is offline     Reply With Quote
Old 07-09-2008, 08:36 PM   #5
CJS
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.
CJS is offline     Reply With Quote

Reply

Submit thread to Digg | Submit thread to del.icio.us | Submit to LQ Bookmarks

« Back to Top »

Thread Tools

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is 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



Add LQ To Your Yahoo Add LQ To Your Google Add LQ To Your MSN Add LQ To Your Blog
All times are GMT -5. The time now is 10:11 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
RSS2  LQ Podcast
RSS2  LQ Radio
Open Source Consulting | Domain Registration