BIND, DHCP

General discussion about PLUC and Linux in Pakistan.
waqaskhawaja
Lance Naik
Posts: 44
Joined: Thu Aug 31, 2006 8:52 pm
Location: Lahore Pakistan
Contact:

BIND, DHCP

Postby waqaskhawaja » Tue Jan 23, 2007 5:54 pm

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?

irfanbhatti
Havaldaar
Posts: 145
Joined: Fri Jun 03, 2005 12:19 pm
Location: Rawalpindi Islamabad
Contact:

Re: BIND, DHCP

Postby irfanbhatti » Tue Jan 23, 2007 6:27 pm

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;
}
Muhammad Irfan
03335246272

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Re: BIND, DHCP

Postby lambda » Tue Jan 23, 2007 11:19 pm

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.

sakimustafa
Lance Naik
Posts: 41
Joined: Sat Jan 13, 2007 1:36 pm
Location: Bangladesh
Contact:

Postby sakimustafa » Wed Jan 24, 2007 10:49 am

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;
}
Best Regards,
SAKI
8801712764543

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Postby lambda » Wed Jan 24, 2007 12:32 pm

i don't think he has access to the dhcp server.

waqaskhawaja
Lance Naik
Posts: 44
Joined: Thu Aug 31, 2006 8:52 pm
Location: Lahore Pakistan
Contact:

Postby waqaskhawaja » Thu Jan 25, 2007 3:42 pm

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

sohaileo
Naik
Posts: 54
Joined: Mon Dec 26, 2005 1:43 pm
Contact:

Postby sohaileo » Wed Feb 07, 2007 2:10 pm

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.
Sohail Riaz, RHCE
HPC Consultant
Email : sohaileo@gmail.com, riazsx@aramco.com
Web : http://www.sohailriaz.com

waqaskhawaja
Lance Naik
Posts: 44
Joined: Thu Aug 31, 2006 8:52 pm
Location: Lahore Pakistan
Contact:

Postby waqaskhawaja » Thu Feb 08, 2007 1:11 am

Thank you sohaileo but I edited dhclient.conf to remove "domain-name-servers" from the list of "request". It works now.


Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest