LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 01-27-2003, 09:25 AM   #1
afpe
LQ Newbie
 
Registered: Jan 2003
Posts: 2

Rep: Reputation: 0
How to get another machine's hostname?


Hi,

I would like to know is there any way to retrieve another machine's hostname by that machine's IP4/IP6 address? For instance, how can a router acting linux machine gets the 'hostname' from any of its client by using that client's IP address?

If you know please help me with any/multi solutions.

Thanx.

- Afpe
 
Old 01-27-2003, 10:24 AM   #2
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
if the reverse lookup has been setup on that machine just use "host x.x.x.x"

The results aren't always correct, if the host name changed without the reverse lookup changing then you could have something incorrect and alot of pepole don't bother setting up their reverse lookups. Also anyone can fake a reverse lookup to any hostname they want to.
 
Old 01-27-2003, 10:33 AM   #3
afpe
LQ Newbie
 
Registered: Jan 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Thanx for your tips.
Well, you are right about reverse lookup as most of the people do not bother to set those up! Any other idea?

- Afpe
 
Old 01-27-2003, 10:41 AM   #4
Darin
Senior Member
 
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024

Rep: Reputation: 45
I'd suggest traceroute but that just does a reverse lookup (but at least it works in m$ land where there is no host command.) Another suggestion would be to sniff the network but that's sort of like using a shotgun to hunt a fly. Also in windows land all the computers broadcast their names or register with a wins server but I haven't found a way to get native *nix apps besides samba to use netbios style name resolution yet.
 
Old 01-27-2003, 07:59 PM   #5
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
You can get *nix apps to use netbios style name lookups by installing winbindd and adding a line in /etc/nsswitch.conf
 
  


Reply



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
Suspend to Disk failed, now machine's CPU usage makes machine unusable tisource Linux - General 2 09-11-2005 05:20 PM
How do I get my machine's up time programmatically? MClayton Linux - General 2 03-11-2005 12:39 PM
i can't browse my linux machine from windows machine's network neighbourhood window yagneshmistry Linux - Networking 2 08-10-2004 02:52 AM
How Can I get Client Machine's IP in PHP ritesh_aladdin Linux - Software 3 08-19-2003 03:13 AM
How can one machine access other machine's directory Wagner Linux - Networking 1 06-05-2001 07:37 AM

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

All times are GMT -5. The time now is 12:44 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