LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-17-2005, 06:20 PM   #1
Notwerk
Member
 
Registered: Apr 2005
Location: Jordan
Distribution: Debian (Sarge), Ubuntu (6.06)
Posts: 271

Rep: Reputation: 31
question about dhcp options


Hi

I've setup a dhcp server and it's running fine. I was wondering if i could set it up so that when a client requests an IP it gets any IP from the pool, however, the client's hostname (set on the client side) is also bound to this IP?

edit:
I think I'll have to use the "get-lease-hostnames" in /etc/dhcpd.conf somehow to dynamically modify the /etc/hosts file.

Any suggestions?

Last edited by Notwerk; 12-18-2005 at 12:05 AM.
 
Old 12-19-2005, 05:21 PM   #2
Notwerk
Member
 
Registered: Apr 2005
Location: Jordan
Distribution: Debian (Sarge), Ubuntu (6.06)
Posts: 271

Original Poster
Rep: Reputation: 31
<BUMP>

Does any1 know how I can use "get-lease-hostnames" in /etc/dhcpd.conf to add the DHCP assigned IPs along with the clients' hostnames to /etc/hosts?

Is this a good idea? or would it be a security risk?

I wish to implement this on a local network behind a router/firewall linux box which is also doubling as the DHCP server. The clients on the LAN are mixed (win/lin boxes).
 
Old 12-20-2005, 04:51 AM   #3
DaveG
Member
 
Registered: Nov 2001
Location: London, UK
Distribution: Fedora
Posts: 161

Rep: Reputation: 43
I use ISC bind and dhcpd set up with secure dynamic updates. As a lease is granted, dhcpd also updates the DNS forward and reverse zones with the right info. No hosts files needed. The problem is then how to integrate this local DNS server in to the LAN so all clients use it, and have the server pass queries to the right place.

Check out the dhcpd.conf man page - Dynamic DNS Updates.
 
Old 12-21-2005, 04:01 AM   #4
Notwerk
Member
 
Registered: Apr 2005
Location: Jordan
Distribution: Debian (Sarge), Ubuntu (6.06)
Posts: 271

Original Poster
Rep: Reputation: 31
Thanx for the heads up.... i'll check that.
Any other resources would be appreciated.
 
Old 12-21-2005, 07:54 AM   #5
DaveG
Member
 
Registered: Nov 2001
Location: London, UK
Distribution: Fedora
Posts: 161

Rep: Reputation: 43
The dhcpd.conf man page details how to configure dhcpd for dynamic updates. Section 4.2 of the Bind 9 Administrator Reference Manual covers the bind half of the equation.

If you already have bind running well and on the same box then integration is fairly simple: What it boils down to is adding a few lines to dhcpd.conf to set the update style to "interim", declaring a security key to use and defining the zones to update. Here's the end of my dhcpd.conf:
+++++
# DDNS
ddns-update-style interim;
# For debugging, logging, etc.
# update-optimization off;

# Key split out for security and chroot operation
include "/etc/dhcpd.key";

zone localnet. {
primary 127.0.0.1;
key dhcpdkey;
}

zone 0.168.192.in-addr.arpa. {
primary 127.0.0.1;
key dhcpdkey;
}
-----
The key file was generated with dnssec-keygen.

For named.conf, add a line to include the same key file and add a line to allow secure updates in the forward and reverse zones for your local (dhcp) network. e.g.
+++++
include "/etc/dhcpd.key";
zone "localnet" IN {
type master;
file "localnet.fdb";
allow-update { key "dhcpdkey"; };
};

// Main reverse local zone maintained by dhcpd
zone "0.168.192.in-addr.arpa" IN {
type master;
file "localnet.rdb";
allow-update { key "dhcpdkey"; };
};
-----
Note the differences with trailing dots in the two files. Make sure that the named user identity can write to the database directory so it can maintain it's journal files and update the zone files. Also note that you can't just edit the zone files once updates are enabled.

Restart dhcpd and named, check the logs for errors and fix as required.

If your DNS service runs on a different machine then you will need to adjust the IP addresses and copy the security key over.

Hope that helps.
 
Old 12-24-2005, 03:24 PM   #6
Notwerk
Member
 
Registered: Apr 2005
Location: Jordan
Distribution: Debian (Sarge), Ubuntu (6.06)
Posts: 271

Original Poster
Rep: Reputation: 31
Thanx DaveG...

Finally got things running as I wanted. BTW, it was fairly simple as you suggested since bind WAS already up and running on the same server.

Your help is much appreciated.
Merry Christmans
 
  


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
Question on Boot Menu options blair Linux - Newbie 1 05-05-2005 04:12 AM
Kernel 2.6.2 options question - LOCKED options ? tvojvodi Linux - General 0 02-17-2004 04:23 AM
Custom DHCP Options Llawnroc Linux - Networking 1 09-08-2003 12:47 AM
DHCP vendor-encapsulated-options substring bwilliam79 Linux - Networking 1 10-29-2002 10:08 AM
A question about kernel options jeffycli Linux - General 2 01-11-2002 05:10 AM

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

All times are GMT -5. The time now is 10:58 AM.

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