Page 1 of 1

BIND, DHCP

Posted: Tue Jan 23, 2007 5:54 pm
by waqaskhawaja
I installed Bind9 on Ubuntu for caching. I noticed that on restart, contents of /etc/resolv.conf were cleared and the only nameserver visibile was my gateway. I figured that it was happening because my system was obtaining dhcp address from the gateway. I reconfigured my system for a static address and it works now. I want to know if there is a way to configure dhcp client to only obtain address, mask and gateway from dhcp server and use nameservers of its own?

Re: BIND, DHCP

Posted: Tue Jan 23, 2007 6:27 pm
by irfanbhatti
waqaskhawaja wrote:I installed Bind9 on Ubuntu for caching. I noticed that on restart, contents of /etc/resolv.conf were cleared and the only nameserver visibile was my gateway. I figured that it was happening because my system was obtaining dhcp address from the gateway. I reconfigured my system for a static address and it works now. I want to know if there is a way to configure dhcp client to only obtain address, mask and gateway from dhcp server and use nameservers of its own?


use
host ns2 {
next-server ns2.your-domain.com;
hardware ethernet 00:02:c3:d0:e5:83;
fixed-address 40.175.42.254;
}

Re: BIND, DHCP

Posted: Tue Jan 23, 2007 11:19 pm
by lambda
you've figured out that it's receiving those settings from the dhcp server. that leaves you halfway to solving the problem.

look in /etc for dhcp configuration stuff.

Posted: Wed Jan 24, 2007 10:49 am
by sakimustafa
subnet 10.0.0.0 netmask 255.255.255.0 {

option routers 10.0.0.30;
option subnet-mask 255.255.255.0;

option domain-name-servers 202.111.222.195, 212.122.13.200;

option time-offset -18000; # Eastern Standard Time

default-lease-time 21600;
max-lease-time 43200;
host your-host {
hardware ethernet 00:E0:4C:2F:FE:57;
fixed-address 10.0.0.2;
}

Posted: Wed Jan 24, 2007 12:32 pm
by lambda
i don't think he has access to the dhcp server.

Posted: Thu Jan 25, 2007 3:42 pm
by waqaskhawaja
Yes, I don't have access to the dhcp server. That is why I was asking about available options for dhcp client.

Posted: Wed Feb 07, 2007 2:10 pm
by sohaileo
Dear waqas

look for the following lines in your /sbin/dhclient-script file.

Code: Select all

if [ -z "${dhc_dbus}" ] || (( ( dhc_dbus & 1 ) != 1 )); then
        make_resolv_conf


CHANGE IT TO

Code: Select all

if [ -z "${dhc_dbus}" ] || (( ( dhc_dbus & 1 ) != 1 )); then
       # make_resolv_conf


I hope this will help you.... but note dont change the other lines... then your dhclient script may malfunction.

Regards



waqaskhawaja wrote:Yes, I don't have access to the dhcp server. That is why I was asking about available options for dhcp client.

Posted: Thu Feb 08, 2007 1:11 am
by waqaskhawaja
Thank you sohaileo but I edited dhclient.conf to remove "domain-name-servers" from the list of "request". It works now.