Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to obtain hostname with dhcp (solved)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mcsky2
Guru
Guru


Joined: 25 Aug 2005
Posts: 312

PostPosted: Thu Apr 06, 2006 4:56 pm    Post subject: How to obtain hostname with dhcp (solved) Reply with quote

Hi,
I use a dhcp server (isc) that can deliver hostname to client.
How can i do that without enter hostname in /etc/conf.d/hostname.
Thanks


Last edited by mcsky2 on Sat Apr 08, 2006 6:41 am; edited 2 times in total
Back to top
View user's profile Send private message
subrahmanyan
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2004
Posts: 149
Location: Grey Havens

PostPosted: Thu Apr 06, 2006 8:32 pm    Post subject: Reply with quote

Hi, you'll need to modify dhcpd.conf on your DHCP server.

This is probably what you're searching for:
Code:
man dhcpd.conf


Code:
The get-lease-hostnames statement

get-lease-hostnames flag;

The get-lease-hostnames statement is used to tell dhcpd whether  or
not  to  look up the domain name corresponding to the IP address of
each address in the lease pool and use that address  for  the  DHCP
hostname option.  If flag is true, then this lookup is done for all
addresses in the current scope.   By default, or if flag is  false,
no lookups are done.

_________________
emerge -C Microsoft
Back to top
View user's profile Send private message
mcsky2
Guru
Guru


Joined: 25 Aug 2005
Posts: 312

PostPosted: Fri Apr 07, 2006 5:25 am    Post subject: Reply with quote

I don't think so.
I want that my client(s) receives the hostname automatically.

In my dhcp.conf :

host tartufe {
hardware ethernet 00:0F:EA:44:32:67;
server-name "tartufe.mydomain";
fixed-address 10.0.0.28;
option host-name "tartufe";
}
Back to top
View user's profile Send private message
subrahmanyan
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2004
Posts: 149
Location: Grey Havens

PostPosted: Fri Apr 07, 2006 8:34 am    Post subject: Reply with quote

I'm afraid that your config file is correct but the DHCP client can't handle this configuration.

Again take a look at dhcpd.conf man page:
Code:
It  should be noted here that most DHCP clients completely ignore the
host-name option sent by the DHCP server, and there is no way to con-
figure  them  not  to  do  this.    So you generally have a choice of
either not having any hostname to client IP address mapping that  the
client will recognize, or doing DNS updates.   It is beyond the scope
of this document to describe how to make this determination.


Also man page of the client mentions this (man dhcpcd):
Code:
By default dhcpcd will NOT
set hostname of the host to  the  hostname  option  received
from DHCP server.

_________________
emerge -C Microsoft
Back to top
View user's profile Send private message
mcsky2
Guru
Guru


Joined: 25 Aug 2005
Posts: 312

PostPosted: Sat Apr 08, 2006 6:40 am    Post subject: Reply with quote

I found :
I add in /etc/conf.d/net
Code:
dhcpcd_eth0="-HN"

and /etc/conf.d/hostname
Code:
hostname=""
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum