LinuxQuestions.org
Review your favorite Linux distribution.
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 12-15-2001, 11:36 PM   #1
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473

Rep: Reputation: 30
Question Name resolution on a DHCP network!!!?


My two linux boxes are behind an internet gateway/router on a DHCP network. They work just fine. Both happily ping each other. But due to DHCP, I am not able to atttach a name to each machine. Is there a way for me to ping other machine based solely on machine name and not IP address? I dont want to use static IP.

(ON a windows based network, wins resolution would take care of mapping name to IP. My both machines, however, run linux.)

Last edited by concoran; 12-15-2001 at 11:37 PM.
 
Old 12-16-2001, 10:33 AM   #2
te_conway
Member
 
Registered: Apr 2001
Location: MA
Distribution: redhat 7.2
Posts: 182

Rep: Reputation: 30
I'm no expert but I have a similar situation using 1 linux box and 2 win98 clients. Samba and Windows WINS handle the nameserver issue but I still have problems logging into samba. The way I fixed it is to put the clients in the /etc/hosts file.

DHCP seems to assign an IP to a hardware address and maintains that IP unlees you change the network card. So in your case, I think you can add the IP's of your 2 machines to the /etc/hosts file (both machines) because even though they are assigned by DHCP dynamically, they are essentially static once assigned
 
Old 12-16-2001, 11:57 AM   #3
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473

Original Poster
Rep: Reputation: 30
Well, since you are using W98, name resolutions is not difficult since 98 screams all the time about it's ip address. But not so in linux.

DHCP doesn't bind hardware to an ip address. Infact, I get a different IP everytime. It is based on what IP number is free when you log onto network. In my case, whichever machies start first ( i have only two on the network), gets 192.168.0.2. The second one gets 3. This is precisely the reason why I can't map a name to an IP in /etc/hosts.
 
Old 12-16-2001, 12:04 PM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
this is fixed by assigning the mac address to an ip address in dhcpd.conf


host TECH1 {
hardware ethernet 00::xx:d4:a0:r5:17;
fixed-address 192.168.0.5;
}


and the /etc/hosts file is the answer for name resolution

by having dhcp assign the fixed ip the name will also be assigned the ip in etc/hosts


/var/lib/dhcp/dhcpd.leases will contain the host names and mac addresses of all computers that have been assigned an ip by the dhcpd daemon.

Last edited by DavidPhillips; 12-16-2001 at 12:08 PM.
 
Old 12-16-2001, 03:59 PM   #5
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473

Original Poster
Rep: Reputation: 30
Thanks David,

I was wondering if Linux has a NetBEUI equivalent.
 
Old 03-19-2002, 10:40 AM   #6
DiBosco
Member
 
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 807

Rep: Reputation: 40
This is a total piece of cake, but it took me having to read the excellent "Using Samba" O'Reilly book to find out how to do it.

Make one of your Linux machines that is always up on your network a WINS server. This is very simple to do:

Add to your [global] section of the smb.conf file

wins support = yes

Then to any other Linux machines on your network, in their smb.conf files (again in the [global] section):

wins server = xxx.xxx.xxx.xxx
name resolve order = wins lmhosts hosts bcast

where xxx.xxx.xxx.xxx is the IP address of the machine you've made the WINS server in the first step.

You can change the name resolve order order (sic) to whatever you like. You might want to look up the static IP addresses first I suppose, in which case put lmhosts first.

On any Wind*ws clients, go to Notwork Neighbourhood and make the WINS server on there point to IP address xxx.xxx.xxx.xxx

Stop and start your samba daemons, reboot your Windoze clients and hey presto, you can ping to the netbios names to your heart's content.

It really is that easy, but it took me bloody ages to work out!

Cheers,

Rob
 
  


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
DHCP - network down pr1sg Linux - Networking 1 12-10-2008 07:03 PM
Securing network with DHCP gkhewitt Linux - Networking 8 12-19-2004 09:00 AM
2 DHCP servers on a network olefemmy Linux - Networking 2 11-19-2004 10:27 AM
Network issues...No DHCP Brother Michael Slackware 19 01-16-2004 01:04 AM
dhcp network comtronics Debian 3 07-23-2003 11:57 PM

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

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