LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-06-2004, 07:17 PM   #1
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 221

Rep: Reputation: 30
using windows hostnames


I feel like I've got to be missing something simple ...

***/etc/sysconfig/network
Quote:
HOSTNAME=lenny
NETWORKING=yes
GATEWAY=192.168.1.1
***/etc/hosts/***
Quote:
127.0.0.1 localhost
192.168.1.3 lenny
I'm not sure where else to set a hostname. Lenny can't ping any of my other machines by name (they're windows machines) and they can ping eachother, but not lenny by name. Everyone can ping eachother's IP addresses.

Is there something I'm missing about setting up hostnames to talk between networked windows boxes and linux boxes?
 
Old 07-06-2004, 07:20 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 198Reputation: 198
Windows actually has its own hosts file you can hard code the Linux machines name and IP into.. can't remember how to do it though. Its either that or setup a small DNS server..
 
Old 07-06-2004, 07:32 PM   #3
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
C:\WINNT\system32\drivers\etc\hosts

it's a plaintext file, just no extension
 
Old 07-06-2004, 07:48 PM   #4
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 221

Original Poster
Rep: Reputation: 30
Halfway there ...

Great ... edited the host files on the windows boxes and they now know where Lenny resides! Thanks for that!

But Lenny still has no clue who Bob and Wendy are (my two windows machines) ... I know about the hosts file on linux, but Bob and Wendy are DHCP clients, so I can't hard code an IP address into them. Is there some way to call them by MAC address? Or is there another way for linux to discover the host names sitting on the network?
 
Old 07-06-2004, 08:21 PM   #5
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 198Reputation: 198
Re: Halfway there ...

Quote:
Originally posted by JohnLocke
Great ... edited the host files on the windows boxes and they now know where Lenny resides! Thanks for that!

But Lenny still has no clue who Bob and Wendy are (my two windows machines) ... I know about the hosts file on linux, but Bob and Wendy are DHCP clients, so I can't hard code an IP address into them. Is there some way to call them by MAC address? Or is there another way for linux to discover the host names sitting on the network?
Edit your /etc/hosts file in Linux with the appropiate IP to Name... And if you want them to see shares they might have, you'll need to setup www.samba.org
 
Old 07-06-2004, 10:23 PM   #6
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 221

Original Poster
Rep: Reputation: 30
One problem with that ....

The windows boxes are DHCP clients ... so I can't set up IP to name. I suppose I could make the boxes static, but that would defeat some of the purpose of this. Is there a way to be able to read hostnames even if they don't have stable IP addresses?
 
Old 11-10-2006, 05:40 PM   #7
Utah
Member
 
Registered: Apr 2004
Distribution: Fedora Core 3
Posts: 73

Rep: Reputation: 15
I have the same problem. Local DHCP means I can't hard code the names in /etc/hosts.

My DSL router assigns the addresses and knows the names. How do I tell my Linux box to go get the info from the router? (I tried adding the "GATEWAY=192.168.1.1" in /etc/sysconfig/network but that didn't seem to work either.)

Did you ever solve this problem? I see you posted it back in '04.

Mike
 
Old 11-10-2006, 07:52 PM   #8
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
I believe the only reliable solution would be to setup a LAN dns box. For the most part it would just be a caching server, but you could create a zone for your LAN, and allow dynamic updates from the clients. That way if Bob gets bounced by dhcp from 192.168.1.4 to 192.168.1.53, it reports that to the DNS box, and the DNS box updates the localdomain.com zone. That way, you can ask for the address of bob.localdomain.com and get the accurate answer at any time.

You could also setup samba. Samba server would allow you to share files from linux to the windows boxes on your LAN, and samba client would allow the linux box to see the shares on the windows boxes. Either way, you'll have to define the workgroup name in the samba configs, but once that is done and setup correctly, all the computers will know each other's names.

Peace,
JimBass
 
  


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
Is possible to get windows hostnames from a workgroup ? szszekel Linux - Networking 1 04-16-2005 12:06 AM
hostnames thenewguy05 Linux - Networking 1 07-12-2004 05:08 PM
Client (windows) can't ping hostnames HKDude Linux - Networking 5 05-12-2004 06:14 PM
resolve hostnames zero_kewl Linux - General 5 09-01-2003 04:00 AM
Hostnames glj Linux - Networking 3 02-12-2002 10:04 AM


All times are GMT -5. The time now is 11:49 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 Google+: linuxquestions
Open Source Consulting | Domain Registration