dhclient Does Not Set /etc/resolv.conf

dhclient Does Not Set /etc/resolv.conf

Post by Hank Kingwoo » Wed, 04 Feb 2004 15:34:39



I'm running Red Hat 9 and my box acquires a DHCP address, but my
/etc/resolv.conf is not created/updated...  I've checked the man page
for /etc/dhclient.conf settings, but I don't think I got it right.  This
is what I have in /etc/dhclient.conf:

interface "eth0" {
# I put the following two lines in to see if they would be entered
# into /etc/resolv.conf.  They aren't :( .
     supersede domain-name "test.com";
     supersede domain-name-servers 192.168.255.1;
     request subnet-mask, broadcast-address, time-offset, routers,
             domain-name, domain-name-servers, host-name;
     require subnet-mask, domain-name-servers;
# Is the following line needed?
#    script "/sbin/dhclient-script";

Quote:}

Any ideas on how to get /etc/resolv.conf to get the name servers?
 
 
 

dhclient Does Not Set /etc/resolv.conf

Post by johnny bobby be » Wed, 04 Feb 2004 15:58:56


Hank Kingwood typed:

Quote:> Any ideas on how to get /etc/resolv.conf to get the name servers?

are you, by chance, starting/stopping network services _after_ you changed
this?

are you running the 'dhclient' command?
what are you doing to try to get your changes noticed by /etc/resolv.conf?

--
- Linux: the choice of a GNU generation
- free; as in free speech and free beer

remove '.eh' to email

 
 
 

dhclient Does Not Set /etc/resolv.conf

Post by Hank Kingwoo » Thu, 05 Feb 2004 00:41:34



> Hank Kingwood typed:

>>Any ideas on how to get /etc/resolv.conf to get the name servers?

> are you, by chance, starting/stopping network services _after_ you changed
> this?

No.  As root I run "dhclient eth0", I get an IP address, but
/etc/resolv.conf does not get updated...  Just for grins I did "touch
/etc/resolv.conf;dhclient" and /etc/resolv.conf remains at zero bytes...

Quote:> are you running the 'dhclient' command?

Yes.

Quote:> what are you doing to try to get your changes noticed by /etc/resolv.conf?

I thought running "dhclient" with no /etc/dhclient.conf would update
/etc/resolv.conf, but that didn't work on my system.  Then I created
/etc/dhclient.conf and I'm still not getting any resolv.conf update...

Googling returned previous bugs in dhclient.  I'm running
dhclient-3.0pl2-6.16.  So, I thought I could get either the code or RPM
from http://www.isc.org/, but I can't find "dhclient".  DHCP is there,
ftp://ftp.isc.org/isc/dhcp/dhcp-3.0.1rc12.tar.gz.

Is dhclient included in dhcp-3.0.1rc12.tar.gz?

Any recommendations on either compiling dhcp-3.0.1rc12.tar.gz?  Anyone
know where I can find the RPM for this?  I can't find it at rpmfind.net...

Thanks.

 
 
 

dhclient Does Not Set /etc/resolv.conf

Post by Rich Piotrowsk » Thu, 05 Feb 2004 01:21:35




Quote:>I'm running Red Hat 9 and my box acquires a DHCP address, but my
>/etc/resolv.conf is not created/updated...  I've checked the man page
>for /etc/dhclient.conf settings, but I don't think I got it right.  This
>is what I have in /etc/dhclient.conf:

>interface "eth0" {
># I put the following two lines in to see if they would be entered
># into /etc/resolv.conf.  They aren't :( .
>     supersede domain-name "test.com";
>     supersede domain-name-servers 192.168.255.1;
>     request subnet-mask, broadcast-address, time-offset, routers,
>             domain-name, domain-name-servers, host-name;
>     require subnet-mask, domain-name-servers;
># Is the following line needed?
>#    script "/sbin/dhclient-script";
>}

>Any ideas on how to get /etc/resolv.conf to get the name servers?

Actually, in most cases you do not need an /etc/dhclient.conf.

Check your /etc/sysconfig/network-scripts/ifcfg-eth(x) and see if you
have "PEERDNS=yes".

--
"Now are you talking about what it is you know
Or just repeating what it was you heard."
                                        Grace Slick
To E-mail use: rpiotro(at)wi(dot)rr(dot)com

 
 
 

dhclient Does Not Set /etc/resolv.conf

Post by Hank Kingwoo » Thu, 05 Feb 2004 03:02:18





>>I'm running Red Hat 9 and my box acquires a DHCP address, but my
>>/etc/resolv.conf is not created/updated...  I've checked the man page

...

Quote:>>Any ideas on how to get /etc/resolv.conf to get the name servers?

> Actually, in most cases you do not need an /etc/dhclient.conf.

> Check your /etc/sysconfig/network-scripts/ifcfg-eth(x) and see if you
> have "PEERDNS=yes".

Ahhh.  That was it!  I had "PEERDNS=no".  Much thanks!
 
 
 

1. dhclient generates junk in /etc/resolv.conf

There's probably an easy fix for this, but I can't figure it out. When I run
dhclient (FreeBSD 4.1), it does everything right EXCEPT in /etc/resolv.conf,
it puts a \000 at the end of the "search line" like this:

search foo.com\000
nameserver 1.2.3.4
nameserver 1.2.3.5

The "\000" is actually like that, it's not a NUL character in the file. It's
a backslash followed by three 0's. If I manually edit the file after running
dhclient and remove that stuff, name lookup works fine.

The server on the other side is (I think) some evil M$ box and I have 0
chance of getting any configuration on it changed, so it will have to be a
client side thing.

Any ideas? I'd like it to work automatically and not require the hand edit.

--

2. Amazing results

3. Looking for sample /etc/named.conf and etc/resolv.conf and /etc/hosts

4. Linker err during make: HELP!!

5. dhclient.conf to add dns in resolv.conf

6. Printing to two printers from one queue (Printers print identically not load balancing)

7. dhclient - broken? Does not install resolv.conf

8. Linux Router Telnet Session Timeout

9. /etc/resolv.conf "search" not working...

10. How come nameserver with a host name not work in /etc/resolv.conf

11. Help with /etc/hosts and /etc/resolv.conf

12. comments in /etc/hosts, /etc/resolv.conf

13. config /etc/resolv.conf to use /etc/hosts first for DNS??