LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 10-23-2003, 01:28 AM   #1
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
Sending hostname along with DHCP request


Hi there.

I have several computers networked together with one being the gateway/DHCP server. It all works just fine except for one thing. I was wondering if it was at all possible to send a computer's host name along with the DHCP request.

To explain further... Let's say I have a computer (IP 192.168.0.1) acting as a gateway and three other computers (DHCP assigned addresses) networked to it through a hub. Let's say the gateway's hostname is "gateway" and the other three computers are called "comp1", "comp2" and "comp3". As it stands, to telnet to any of the other three computers, I have to type telnet <IP address>. Is it at all possible to dynamically assign host names as well? In other words, I'd like to be able to type telnet comp1, for example. This is easy with static IPs but these are dynamic. So i'd either like each computer to send it's unique hostname to the DHCP server (and hence to the rest of the network) or each computer to request a specific IP from the DHCP server (and then I could edit /etc/hosts as usual confident in the knowledge that the IP will be the same each time).

Any suggestions?

Last edited by adz; 10-23-2003 at 01:29 AM.
 
Old 10-23-2003, 01:37 AM   #2
born4linux
Senior Member
 
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127

Rep: Reputation: 49
bind the hostname to the IP addresses you are leasing to your clients. And you can pick which machine get's the IP via the MAC addresses of their NICs.

this is a combination of DCHP and DNS service setup.

something like (in dhcpd.conf):

host client1 {
next-server client1.domain.org;
hardware ethernet 12:xx:xx:xx:xx:xx;
fixed-address 192.168.0.1;
}


(in your dns zone file):
client1 IN A 192.168.0.1


hth.

Last edited by born4linux; 10-23-2003 at 01:48 AM.
 
Old 10-23-2003, 01:50 AM   #3
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Original Poster
Rep: Reputation: 53
How do I do that? I presume I have to edit the dhcp.conf file but what options do I put in it?
 
Old 10-23-2003, 08:12 AM   #4
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
You can assign hostnames via DHCP, but the name lookups are done via DNS. comp1 doesn't know that comp2 points to IP2 without a DNS lookup. To get around this, you can run your own local DNS server or create hosts files on each machine.
 
Old 10-23-2003, 10:15 AM   #5
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Original Poster
Rep: Reputation: 53
Yeah I was hoping to avoid the hosts files. There's no guarantee that comp1 will get the same IP assigned to it each time. It generally does, I have to say, but it's not a robust system. I want something bulletproof. Or at least fairly reliable. Could you give me a few pointers on setting up a DNS server? Or at least point me to a good HOWTO? Oh and how exactly do I assign host names via DHCP?
 
  


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
sending an arp request jagman Programming 2 02-27-2006 02:59 PM
why DHCP client not sending own host name in DHCP request packet? sonika_singhi Linux - Networking 7 05-28-2005 05:18 AM
sending with exim: need fully-qualified hostname otoomet Linux - Networking 1 01-06-2005 02:55 PM
DHCP Request Ynog Linux - Networking 2 06-24-2004 03:04 PM
dhcp request ip abs Slackware 3 02-16-2004 04:39 AM

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

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