Networking Forums

Networking Forums > Computer Networking > Linux Networking > DHCP: overriding hostname of clients

Reply
Thread Tools Display Modes

DHCP: overriding hostname of clients

 
 
Stefan Bellon
Guest
Posts: n/a

 
      10-23-2004, 07:34 AM
I have a running DHCP server together with interim DHCP-DNS interaction
on my Debian unstable machine. I have set up a subnet declaration like
this in the dhcpd.conf file:

subnet 192.168.0.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
option ntp-servers roma.localnet;
range 192.168.0.100 192.168.0.105;
}

That works fine. I get leases like the following in the dhcpd.leases
file:

lease 192.168.0.103 {
starts 6 2004/10/23 07:10:25;
ends 0 2004/10/24 07:10:25;
binding state active;
next binding state free;
hardware ethernet xx:xx:xx:xx:xx:xx;
uid "xxxxxxxxxxxx";
set ddns-rev-name = "103.0.168.192.in-addr.arpa.";
set ddns-txt = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
set ddns-fwd-name = "vici.localnet";
client-hostname "vici";
}

However there is one client in my network that isn't sending a
client-hostname in its DHCP request. Therefore the dynamic DNS updating
doesn't put it in my name server.

What's the best way of dealing with this problem?

I already thought about making a special rule in the dhcpd.conf file
that overrides the hostname of the client if it's the one with that
specific hardware ethernet address. However I didn't manage to do that.
Neither am I sure whether this is the right apporach.

I'd be grateful for any hints.

--
Stefan Bellon
 
Reply With Quote
 
 
 
 
Walter Mautner
Guest
Posts: n/a

 
      10-23-2004, 10:48 AM
Stefan Bellon wrote:

> I have a running DHCP server together with interim DHCP-DNS interaction
> on my Debian unstable machine. I have set up a subnet declaration like
> this in the dhcpd.conf file:
>

......
> However there is one client in my network that isn't sending a
> client-hostname in its DHCP request. Therefore the dynamic DNS updating
> doesn't put it in my name server.
>
> What's the best way of dealing with this problem?
>
> I already thought about making a special rule in the dhcpd.conf file
> that overrides the hostname of the client if it's the one with that
> specific hardware ethernet address. However I didn't manage to do that.
> Neither am I sure whether this is the right apporach.


http://ops.ietf.org/dns/dynupd/secure-ddns-howto.html
Look for " Setting the hostname for clients not sending the fqdn or
host-name"
--
Longhorn error#4711: TCPA / NGSCB VIOLATION: Microsoft optical mouse
detected penguin patterns on mousepad. Partition scan in progress
*to*remove*offending*incompatible*products.**Reactivate*your*MS*software.
Linux woodpecker.homnet.at 2.6.8reiser4pkt*[LinuxCounter#295241]
 
Reply With Quote
 
Stefan Bellon
Guest
Posts: n/a

 
      10-23-2004, 04:19 PM
Walter Mautner wrote:
> Stefan Bellon wrote:

[snip]
> > However there is one client in my network that isn't sending a
> > client-hostname in its DHCP request. Therefore the dynamic DNS
> > updating doesn't put it in my name server.
> >
> > What's the best way of dealing with this problem?

[snip]
> http://ops.ietf.org/dns/dynupd/secure-ddns-howto.html
> Look for " Setting the hostname for clients not sending the fqdn or
> host-name"


Thanks. I just noticed that the code fragment given in this howto is
even present in the Debian default configuration of dhcpd.conf but
commented out.

But it isn't what I'm looking for (or I don't understand how to apply
it to my problem). I'm not looking for a general solution for _many_
clients that are not sending the name but for _one_specific_ whose MAC
address I know and whom I want to assign a specific name.

My attempt (that didn't work) was this:

subnet 192.168.0.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
option ntp-servers roma.localnet;
range 192.168.0.100 192.168.0.105;

host veni {
ethernet address xx:xx:xx:xx:xx:xx;
host-name "veni.localnet";
}
}

After reading your suggestion, I guess I could use this approach:

ddns-hostname = pick (option fqdn.hostname, option host-name,
"veni.localnet");
option host-name server.ddns-hostname;

subnet 192.168.0.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
option ntp-servers roma.localnet;
range 192.168.0.100 192.168.0.105;
}

But this way not only the one with the specific MAC address but all
clients not sending the host name would get that host name.

--
Stefan Bellon
 
Reply With Quote
 
Walter Mautner
Guest
Posts: n/a

 
      10-24-2004, 09:15 AM
Stefan Bellon wrote:

......
> But it isn't what I'm looking for (or I don't understand how to apply
> it to my problem). I'm not looking for a general solution for _many_
> clients that are not sending the name but for _one_specific_ whose MAC
> address I know and whom I want to assign a specific name.
>
> My attempt (that didn't work) was this:
>
> subnet 192.168.0.0 netmask 255.255.255.0 {
> option subnet-mask 255.255.255.0;
> option broadcast-address 192.168.0.255;
> option routers 192.168.0.1;
> option ntp-servers roma.localnet;
> range 192.168.0.100 192.168.0.105;
>
> host veni {
> ethernet address xx:xx:xx:xx:xx:xx;
> host-name "veni.localnet";
> }
> }
>

Oh, should rather look like
host veni {
hardware ethernet xx:yy:zz:aa:bb:cc;
ddns-hostname = pick("veni.localnet");
option host-name = config-option server.ddns-hostname;
}

--
Longhorn error#4711: TCPA / NGSCB VIOLATION: Microsoft optical mouse
detected penguin patterns on mousepad. Partition scan in progress
*to*remove*offending*incompatible*products.**Reactivate*your*MS*software.
Linux woodpecker.homnet.at 2.6.8reiser4pkt*[LinuxCounter#295241]
 
Reply With Quote
 
Stefan Bellon
Guest
Posts: n/a

 
      10-24-2004, 12:41 PM
Walter Mautner wrote:
> Stefan Bellon wrote:


> > But it isn't what I'm looking for (or I don't understand how to
> > apply it to my problem). I'm not looking for a general solution for
> > _many_ clients that are not sending the name but for _one_specific_
> > whose MAC address I know and whom I want to assign a specific name.
> >
> > My attempt (that didn't work) was this:
> >
> > subnet 192.168.0.0 netmask 255.255.255.0 {
> > option subnet-mask 255.255.255.0;
> > option broadcast-address 192.168.0.255;
> > option routers 192.168.0.1;
> > option ntp-servers roma.localnet;
> > range 192.168.0.100 192.168.0.105;
> >
> > host veni {
> > ethernet address xx:xx:xx:xx:xx:xx;


hardware ethernet xx:xx:xx:xx:xx:xx;

> > host-name "veni.localnet";


option host-name "veni.localnet";

> > }
> > }


The above two have been typos in my posting and not in my dhcpd.conf
file.

> Oh, should rather look like
> host veni {
> hardware ethernet xx:yy:zz:aa:bb:cc;
> ddns-hostname = pick("veni.localnet");
> option host-name = config-option server.ddns-hostname;
> }


Ah, that's what I was looking for! Thanks a lot! I had to change the
one line to read

ddns-hostname = pick("veni");

as otherwise the computer would have been called
"veni.localnet.localnet" but apart from this, your suggestion works and
I'm a happy person now. :-)

--
Stefan Bellon
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
My hostname not being registered via DHCP UncleStoner Linux Networking 9 02-03-2005 03:42 AM
How to use hostname to connect to a DHCP client machine? Steve Dondley Linux Networking 2 02-04-2004 12:38 AM
assigning hostname to unknown clients Florian Effenberger Linux Networking 1 10-07-2003 12:30 PM
Mandrake Assigns Hostname Before DHCP? ignatius@notreal.net Linux Networking 0 09-29-2003 02:38 PM
dns update from dhcp server ok for windows clients, not ok for linux (dhclient) clients Tom Van Overbeke Linux Networking 3 08-07-2003 03:24 PM



1 2 3 4 5 6 7 8 9 10 11