Find the answer to your Linux question:
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.
  1. #1
    Just 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...

  2. #2
    Linux 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:
    Code:
    dd bs=16 count=1 </dev/random 2>/dev/null | base64-encode
    Then wrap that key in an ISC key descriptor file - that is, create a file that looks like this:
    Code:
    key "dhcp-ddns" &#123;
            algorithm hmac-md5;
            secret "insert-your-key-here";
    &#125;
    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.

    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:
    Code:
    include "/etc/dhcp.key";
    Then, there are three changes you need to do to your /etc/dhcpd.conf:

    1. Insert this line near the top:
    Code:
    ddns-update-style interim;
    2. Insert this line in your subnet declaration(s):
    Code:
    ddns-domainname "your-domain-name.tld.";
    3. Add zone descriptors (anywhere in the file):
    Code:
    zone your-domain-name.tld. &#123;
            primary ip.of.your.dnsserver;
            key "dhcp-ddns";
    &#125;
    
    zone 168.192.in-addr.arpa. &#123;
            primary ip.of.your.dnsserver;
            key "dhcp-ddns";
    &#125;
    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.

    Then, lastly, update your named.conf. Luckily, this step is the easiest. Just add this line to the zone declarations in it:
    Code:
    allow-update &#123; key dhcp-ddns; &#125;;
    That should work, if I'm not mistaken.

  3. #3
    Just 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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •