[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: **Getting** dhcp to write /etc/resolv.conf



Kenward Vaughan <kaynjay@igalaxy.net> writes:
> 
> The only thing I can see which appears a bit odd is a line in the
> dhclient-script:
> 
> make_resolv_conf() {
>   if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
>        ^^^^^       compared with       ^^^^^^^
>     echo search $new_domain_name >/etc/resolv.conf

No, there's nothing overtly wrong with that---the comparisons will do
the same thing.

Try adding two lines to the beginning of that function:

make_resolve_conf() {
  echo new_domain_name="$new_domain_name" > /etc/resolv.log
  echo new_domain_name_servers="$new_domain_name_servers" >>/etc/resolv.log
  . . . 

and bring the interface "ifdown" and back "ifup".  Make sure that
"/etc/resolv.log" is created and that it shows that both variables
have been assigned non-null values.  It may be that your ISP's DHCP
server is simply not configured to provide both pieces of requested
information, even when asked.

If the problem is that its supplying the servers but not the domain
name, replace the whole function with:

make_resolve_conf() {
  if [ x"$new_domain_name_servers" != x ]; then
    > /etc/resolv.conf
    chmod 644 /etc/resolv.conf
    for nameserver in $new_domain_name_servers; do
      echo nameserver $nameserver >>/etc/resolv.conf
    done
  fi
}

[[ There's no particular reason to use an ISP-supplied search path
anyway.  Do you really want to use "http://www/"; to access your ISP's
homepage?  ;) ]]

> I _could_ keep running off the old isp's DNS, but that doesn't feel right,
> and I think it contributes to some latency (not critical to me, but my wife
> keeps looking for the perfect shopping experience... :)

Well, you should be able to determine your new ISP's DNS servers and
hardcode them manually.  Try "host dns.yourisp.net", "host
dns1.yourisp.net", or "host dns2.yourisp.net" and try out those IP
addresses.  Or, take a peek at your ISP's support pages.  They
probably have it documented somewhere.

-- 
Kevin <buhr@telus.net>



Reply to: