Results 1 to 3 of 3
Hi there,
I have a dhcpd and a named running at my local network.
How can I make the dhcpd daemon to comunicate with named daemon?
I want to have ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-02-2004 #1Just Joined!
- Join Date
- Jun 2004
- Location
- Leiria - Portugal
- Posts
- 72
Named and dhcpd
Hi there,
I have a dhcpd and a named running at my local network.
How can I make the dhcpd daemon to comunicate with named daemon?
I want to have new A records in my zone files every time a new machine boots up and get a new IP address from my dhcpd.
How we do this?
Thanks in advance...
- 07-02-2004 #2Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
Well, that's a job for DDNS. There are a number of ways to do it, and the theory isn't very hard, but rather long, so I'd prefer not to re-write it all in this post. Check out DYNAMIC DNS UPDATES in the dhcpd.conf(5) manpage for details.
Here's how I did it. First of all you need a DDNS key. Unfortunately, I don't remember the canonical way to do this, but you can use this alternative way. Generate a 128-bit BASE64-encoded key:
Then wrap that key in an ISC key descriptor file - that is, create a file that looks like this:Code:dd bs=16 count=1 </dev/random 2>/dev/null | base64-encode
The "dhcp-ddns" is the name of the key. You can name it anything you want, but I named mine dhcp-ddns. Insert the result you got from the command on the "secret" line. Then save this file as something like /etc/dhcp.key. I suggest you set mode 640 and owner:group=root:named on this file. If you have dhcpd and named running on different servers, copy this file to both of them.Code:key "dhcp-ddns" { algorithm hmac-md5; secret "insert-your-key-here"; }
OK, then you have a key. Next comes the configuration of /etc/dhcpd.conf and /etc/named.conf. In both, insert this line near the top to include the key you created:
Then, there are three changes you need to do to your /etc/dhcpd.conf:Code:include "/etc/dhcp.key";
1. Insert this line near the top:
2. Insert this line in your subnet declaration(s):Code:ddns-update-style interim;
3. Add zone descriptors (anywhere in the file):Code:ddns-domainname "your-domain-name.tld.";
If you have named and dhcpd running on the same server, ip.of.your.dnsserver would probably better be left as 127.0.0.1. Also, if you don't use a 192.168.x.x subnet, you need to change the "168.192.in-addr.arpa." zone accordingly. Needless to say, it should match the zone declaration of your existing reverse lookup zone in named.conf.Code:zone your-domain-name.tld. { primary ip.of.your.dnsserver; key "dhcp-ddns"; } zone 168.192.in-addr.arpa. { primary ip.of.your.dnsserver; key "dhcp-ddns"; }
Then, lastly, update your named.conf. Luckily, this step is the easiest. Just add this line to the zone declarations in it:
That should work, if I'm not mistaken.Code:allow-update { key dhcp-ddns; };
- 07-02-2004 #3Just Joined!
- Join Date
- Jun 2004
- Location
- Leiria - Portugal
- Posts
- 72
Thanks again
Once again, thanks a lot Dolda2000
It makes all sense, and is that key that I'm missing in my configuration files.
I will try it latter at home, after work, and let you know the results.
You have been just great, keep it just like that, and I promess that I will help when ever I can.
See you...


Reply With Quote
