# Bind + dhcpd [solved]

## mattes

Hi,

I'm trying (almost the whole day  :Sad:  ) to get Bind working with dynamic assigned IP-Addresses.   

(Both is seperatly working fine but not in common)

I found this:

http://www.cameratim.com/computing/linux/using-bind-as-a-local-dns-server#master-named-config

and some other stuff, but it doesn' t work. I'm running BIND in a chroot, perhaps that has an effect?

Any advice is welcome  :Wink: 

Regards MattesLast edited by mattes on Sat Jun 13, 2009 1:52 pm; edited 2 times in total

----------

## ianw1974

I think if the BIND server is OK, you just want to be modifying the DHCP server to give a particular DNS IP - in this instance - your BIND server.

I did this with my firewall, but if you're using dhcpd under Linux, then you'll need to modify the dhcpd.conf file for it to know what DNS to provide - or whatever is giving you the DHCP addresses.

----------

## mattes

 *ianw1974 wrote:*   

> then you'll need to modify the dhcpd.conf file for it to know what DNS to provide - or whatever is giving you the DHCP addresses.

 

of course, thats what I did and whts described in the tutorial Ive posted above.

```

include "/etc/rndc.key";

ddns-domainname         "example.com.";

ddns-rev-domainname     "in-addr.arpa.";

ddns-update-style       interim;

ddns-updates            on;

allow                   client-updates;
```

But it doesnt work. I've tried some modifications and searched the web, but there must be somthing wrong with my configuration. Iam not sure if it isnt the chroot jail...

----------

## ianw1974

Sorry, didn't see the bit about dhcpd.conf in that link you posted!

I never run my BIND in chroot jail, so there is a chance it could be that.  I can't think of what else it would be as that's really the only difference you have in terms of my config.

----------

## vaguy02

If I understand your question correctly, you have not set below in your subnet 

```

option domain-name-server <<ip>>

```

Full example below:

```

authoritative;

ddns-update-style interim;

subnet 192.168.0.0 netmask 255.255.255.0 {

        range 192.168.0.100 192.168.0.220;

        default-lease-time 259200;

        max-lease-time 518400;

        option subnet-mask 255.255.255.0;

        option broadcast-address 192.168.0.255;

        option routers 192.168.0.1;

        option domain-name-servers 192.168.0.3;

}

```

----------

## mattes

Hello,

I've already set the options.

meanwhile Ive found this:

http://www.void.gr/kargig/blog/2006/12/21/dynamic-hostname-updates-with-dhcpd-bind/

Ive made all configfiles new, but its still not working.

To make this task more clear:

What I want is resolving the Names of machines to IP adresses in the local network. So if the computer PC1 is connected to the network, it gets a IP-address and I can connect it by its name PC1 and dont need to know its IP Address.

----------

## chemicalnut

I remember having the same problem some time ago. But instead of bind I had the dhcpcd in a chroot. My problem was that the dhcp user that was used in the chroot wasn't allowed to update the zones of bind. 

In my case I had to add the appropriate user to the named group in the /etc/group. Maybe you have to have a look at your users...

By the way: Did you ever try if your setup works when both services are not chroot'ed? This could help narrowing down the problem.

----------

## mattes

Ive checked the users. But without success...

How can I dechroot BIND?  :Embarassed: 

Regards mattes

----------

## chemicalnut

If you installed it via portage, it should be sufficient to comment the line containing CHROOT="/path/to/your/chroot/" from your /etc/conf.d/named. Of course you have to copy all relevant config files from your chroot to the "default" locations, which are /var/bind and /etc/bind.

After that your bind should start unchrooted.

----------

## mattes

Thx. but still not working.  I will delete everything and start from scratch...

----------

## mattes

Hi, ok its up and running   :Very Happy: .

But unfortunately I dont know what the problem was...

----------

