[Samba] [Fwd: Samba-3 By Ex Chapt 3]

Dwight Tovey dtovey at emergecore.com
Wed Jul 6 17:01:31 GMT 2005


Eric Hines said:
> Yes, I am--or at least I think so; the daemon is running, and it's
> configured according the the Chapt 3 example.  The /etc/resolv.conf file
>  says it's written by /etc/dhclient-script, so I disabled that file,
> adjusted the resolv and tried again.  No effect.  Also, during reboot,
> when dhcpd started up, I got the error message "Not configured to listen
>  on any interface.  Wrote 5 new leases."  When the reboot completed, I
> had no Internet connection whatsoever.  I had to re-enable
> dhclient-script and reboot.
>
> So I remain with the problems that I have no DNS resolution capability,
> and I cannot edit, with permanence, /etc/resolv.conf.  I'd probably be
> satisfied with the latter if I could get DNS to work.
>

You need to understand the difference between dhcpd and dhcpcd.  dhcpd is
the server that provides network configuration information to other
clients out on the network.  dhcpcd is the client part that requests that
configuration info from the server.  If the other machines on your
internal network have static IP addresses, then you don't need to be
running dhcpd.  However, you probably do want to run dhcpcd on your
gateway machine because it gets the network config info from your ISP.

You can tell dhclient to get the IP address and gateway info, but to
ignore what the server tells it to do for the DNS server.  Look at the man
pages for dhclient-script.  If you create an executable script called
/etc/dhclient-enter-hooks and in there define the function
'make_resolv_conf()', you can override how your /etc/resolv.conf gets
handled.  I have one on a FC3 machine at home.  I can't get to it at the
moment, but from memory I believe that you can do something like this in
dhclient-enter-hooks:

===================================8<---------------------------------
#!/bin/bash

make_resolv_conf() {
cat > /etc/resolv.conf <<EOF
search mydomain.net
nameserver 192.168.52.1
EOF
}

===================================8<---------------------------------

Of course, you could also just define make_resolv_conf() as an empty
function and it will just leave the current /etc/resolv.conf alone.

    /dwight
-- 
Dwight N. Tovey
email: dtovey at emergecore.com
---------
Work to Live : Live to Ride : Ride to Work





More information about the samba mailing list