View previous topic :: View next topic |
Author |
Message |
ocbMaurice Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/gallery/Monkey Island/Monkey_Island_-_Guybrush2.gif)
Joined: 14 Feb 2003 Posts: 90 Location: Switzerland
|
Posted: Sun Feb 23, 2003 10:15 pm Post subject: using dhcp with bind to resolve hostnames within you LAN |
|
|
Hi,
Basically this evolved from a problem which I had with gentoo. I have my name- and dhcp-server working together to be able to resolve my hosts via the nameserver. Sadly, the gentoo network scripts (net.ethx) do not really support this setup as they do not take use of the hostname for dhcp. So far, every other linux distribution seems implement the hostname-feature for dhcp.
First thing is a nameserver; for completeness, I give you a short overview of my /etc/named.conf :
Code: | key "DHCP_UPDATER" {
algorithm hmac-md5;
secret "a421afe49cdub3VnaCBmb3IgYSBtYu324212355234234m9yIGEgd29tYW4K";
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file "myzone.net.arpa";
allow-update { key "DHCP_UPDATER"; };
allow-transfer { none; };
};
zone "myzone.net" {
type master;
file "myzone.net.zone";
allow-update { key "DHCP_UPDATER"; };
allow-transfer { none; };
};
|
The corresponding dhcpd.conf looks the fallowing :
Code: | ddns-update-style interim;
key "DHCP_UPDATER" {
algorithm hmac-md5;
secret "a421afe49cdub3VnaCBmb3IgYSBtYu324212355234234m9yIGEgd29tYW4K";
};
....
option domain-name "myzone.net";
option domain-name-servers 192.168.0.109;
option nis-domain "myzone.net";
default-lease-time 600;
max-lease-time 7200;
range 192.168.0.50 192.168.0.99;
zone myzone.net {
primary 192.168.0.109;
key DHCP_UPDATER;
}
zone 0.168.192.in-addr.arpa. {
primary 192.168.0.109;
key DHCP_UPDATER;
}
|
With this setup, every host that aquires an IP from your DHCP server should be inserted into your local nameserver (both, nameserver and dhcp-server run on the same machine). For this to happen, the dhcp-server needs to know the hostname and as it seems, this only is submited when you give the hostname as an argument to dhcpcd (-h hostname). Therefore I adjusted "/etc/init.d/net.eth0". In my case this was line 26 and it should look like this :
Code: | local dhcp_args="$(eval echo \$\{dhcpcd_${IFACE}\}) -h $(eval hostname)" |
If everything works correctly you now can resolve all hosts that aquired their IPs trough the dhcp-server. It's highly suggested that you take use of the dhcp 'option domain-name "myzone.net";'.
I'm quite new to gentoo and didn't find a "feature request" place. Maybe this could be included in future releases !?
greets, Maurice |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
tkdack n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/Futurama/cartoon_futurama_fry_2.gif)
Joined: 12 Apr 2002 Posts: 44 Location: Sydney, Australia
|
Posted: Sun Feb 23, 2003 10:22 pm Post subject: |
|
|
Quote: | For this to happen, the dhcp-server needs to know the hostname and as it seems, this only is submited when you give the hostname as an argument to dhcpcd (-h hostname). |
You might try adding something similar to /etc/conf.d/net. There is an environment variable in there that you can set to pass extra options to dhcpcd. This means you don't have to hack your net.eth0 startup script. _________________ Troy
http://linux.tkdack.com
Former Gentoo contributor TaD |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
BonezTheGoon Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/422034663d604d7679038.jpg)
Joined: 14 Jun 2002 Posts: 1408 Location: Albuquerque, NM -- birthplace of Microsoft and Gentoo
|
Posted: Wed Feb 26, 2003 5:38 pm Post subject: Re: using dhcp with bind to resolve hostnames within you LAN |
|
|
ocbMaurice wrote: | I'm quite new to gentoo and didn't find a "feature request" place. Maybe this could be included in future releases !? |
File a bug report if you would like to have this added into future releases.
Regards,
BonezTheGoon |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|