Re: how to stop resolv.conf from being updated

From: T Kellers (kellers_at_njit.edu)
Date: 05/30/03

  • Next message: Robert Westendorp: "Re: how to stop resolv.conf from being updated"
    To: "John Straiton" <jsmailing@clickcom.com>, "'Laszlo Vagner'" <george@vagner.com>, <freebsd-questions@freebsd.org>
    Date: Fri, 30 May 2003 14:40:29 -0400
    
    

    A sledgehammer approach to make it work:

    Comment out the following lines from /sbin/dhclient-script

    make_resolv_conf() {
      if [ x"$new_domain_name_servers" != x ]; then
        if [ "x$new_domain_name" != x ]; then
          echo search $new_domain_name >/etc/resolv.conf
        else
          rm /etc/resolv.conf
        fi
        for nameserver in $new_domain_name_servers; do
          echo nameserver $nameserver >>/etc/resolv.conf
        done
      fi
    }

    This will prevent dhcp from making a new /etc/resolv.conf file (on boot,
    re-boot). Whatever nameserver you enter in /etc/resolv.conf will stay put.

    (I had to take this approach some years ago when I was using an apple airport
    basestation as my gateway, and the dhcp server software kept assigning
    10.0.1.1 as my nameserver in /etc/resolv.conf.)

    Check the dhclient.conf man page, too, for less drastic measures.

    Tim Kellers
    CPE/NJIT

    On Friday 30 May 2003 02:22 pm, John Straiton wrote:
    >You could always use chflags to make the file un-writeable... Tho' there
    >is probably a better solution
    >
    >#chflags schg /etc/resolv.conf
    >
    >John Straiton
    >jks@clickcom.com
    >Clickcom, Inc
    >704-365-9970x101
    >
    >> -----Original Message-----
    >> From: owner-freebsd-questions@freebsd.org
    >> [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of
    >> Laszlo Vagner
    >> Sent: Friday, May 30, 2003 2:09 PM
    >> To: questions@freebsd.org
    >> Subject: how to stop resolv.conf from being updated
    >>
    >>
    >> I am using DHCP on a cable modem and my
    >> providers nameserver really sucks
    >> but changing my resolv.conf repairs
    >> the lookups for a little while then it gets
    >> set back to them upon bootup.
    >>
    >> how do i make it stay the way i set it.
    >>
    >>
    >> _______________________________________________
    >> freebsd-questions@freebsd.org mailing list
    >> http://lists.freebsd.org/mailman/listinfo/free> bsd-questions
    >>
    >> To unsubscribe, send any mail to
    >> "freebsd-questions-unsubscribe@freebsd.org"
    >
    >_______________________________________________
    >freebsd-questions@freebsd.org mailing list
    >http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    >To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"

    _______________________________________________
    freebsd-questions@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"


  • Next message: Robert Westendorp: "Re: how to stop resolv.conf from being updated"

    Relevant Pages

    • DCHP overrides default gateway and nameserver on double-nic server.
      ... I am setting up several Linux boxes (RedHat Enterprise Linux 2.1, ... get a default gateway from the DHCP-server. ... the Windows DHCP that seems to say no info on gateway nor nameserver ...
      (comp.os.linux.networking)
    • Re: DCHP overrides default gateway and nameserver on double-nic server.
      ... > kernel 2.4.9-e.27) that use two different ethernet interfaces. ... > get a default gateway from the DHCP-server. ... > the Windows DHCP that seems to say no info on gateway nor nameserver ...
      (comp.os.linux.networking)
    • Re: Automatically get nameservers
      ... the FreeBSD machine ... There's really no need for DHCP. ... the FreeBSD machine can get *its* nameserver addresses from the ... his Windows machines connected thru the FreeBSD machine *automatically* ...
      (freebsd-questions)
    • Re: taming resolv.conf
      ... I still want the nameserver address that is supplied by DHCP to be ... I don't think the static dns server in the interfaces file will override ... the resolvconf docs for this. ...
      (Debian-User)
    • Some Questions about setting up a 9.3 box as a router
      ... Linksys router using DHCP. ... ones that are automatically updated to the external interface by my ISP? ... The DHCP server I set up is assigning IP addresses from the internal ... nameserver information is distributed via DHCP across my LAN. ...
      (alt.os.linux.suse)