LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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
  Search this Thread
Old 06-11-2007, 03:26 PM   #1
ingrix
LQ Newbie
 
Registered: Mar 2007
Distribution: Slackware, Knoppix
Posts: 15

Rep: Reputation: 0
How would I discover hostnames?


This may sound like a simple question to answer, but I've googled my ass off, and I've looked through the man pages, but thus far I haven't been able to find an answer.

My question is this: how would I go about discovering hostnames for other computers on a network? NFS is what I'm worried about here, so suppose I didn't know the hostname or IP address of the NFS server. How would I query a list of computers from the network so as to find it?

Kind of what I am looking for is a smbtree for nfs, if that helps to clarify.

Thank you in advance.
 
Old 06-11-2007, 04:07 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
that's what dns is for, or /etc/hosts
 
Old 06-11-2007, 04:35 PM   #3
ingrix
LQ Newbie
 
Registered: Mar 2007
Distribution: Slackware, Knoppix
Posts: 15

Original Poster
Rep: Reputation: 0
Thank you acid, I'll look into that, although I'm not entirely sure how that will help me in my current situation. I guess I should have described it better

I have a star topology network, with a router at the center going out to the internet from there. Then I have a whole bunch of computers branching off of that, including another router (which my computer is connected to). Is there a way to find out the names of each of the computers on the LAN itself, since I don't have my own personal DNS for it?

EDIT: and this is assuming I don't put anything in the /etc/hosts file, too. Thanks in advance.
 
Old 06-11-2007, 06:11 PM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
arp can give you some information about machines you're directly connected to.

# arp -avn

Although it doesn't do hostnames. Perhaps one step closer anyway. /etc/hosts in the only way to locally apply names to IPs. Unless the connected router is in your /etc/resolv.conf and resolves the ips to names.

whois can resolve IPs to hostnames, but unless you have some sort of interception, it does it at the internet level.

Not that any of this answers your question.
 
Old 06-11-2007, 06:24 PM   #5
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
The only UNIX service which actually broadcasts is CUPS. There is also Bonjour but I'm not familiar with it. You can query NFS servers with rpcinfo. Generally, the idea to advertise every service on the network belongs more to the Windows world.
 
Old 06-12-2007, 03:00 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
as above, but note this is not the way "things are done". you find hostnames via dns entries. that's the point of it.
 
Old 06-12-2007, 03:14 AM   #7
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Perhaps pinging every address on your network will give you an idea of the active IPs? Of course, this doesn't give you their hostnames.

I'm not sure of the ethics of this... If you're not the sys admin, perhaps there's a reason you don't know the hostnames! Couldn't you just go ask someone?
 
Old 06-12-2007, 05:29 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
You can use nmap to scan your network for hosts running specific services. For example:
Code:
 nmap -p2049 192.168.0.0/24
will show you the IPs and hostnames of hosts running nfs. For more options take a look at the manpages.

Regards
 
Old 06-12-2007, 06:34 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
people seem to be missing the point. the question was how to find someones hostname, not how to find NFS servers, or ip addresses...
 
Old 06-12-2007, 07:30 AM   #10
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
I was going off this section of the OP:
Quote:
Originally Posted by ingrix
... so suppose I didn't know the hostname or IP address of the NFS server
Which to me implied that either ip or hostname would suffice.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: You discover something new everyday LXer Syndicated Linux News 0 05-31-2007 07:31 PM
Can't discover bluetooth pc. Guitarist88 Linux - Hardware 3 03-12-2007 01:44 PM
How to discover my rwin value mooreted Linux - Networking 0 12-14-2003 04:42 PM
Compiling discover-2.0.1 Crazed123 Linux - Software 0 12-06-2003 11:05 PM
how to discover essid penguinview Linux - Networking 4 07-14-2003 12:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:58 AM.

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