Re: Clean way of setting usepeerdns in /etc/sysconfig/network-scripts/ifcfg-eth0

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

 



On Wednesday 05 November 2003 12:11, Mike Burger wrote:
> On Wed, 5 Nov 2003, Nicolas Turro wrote:
> > Hi,
> >
> > When installing laptops i need to setup the usepeerdns option in the
> >  /etc/sysconfig/network-scripts/ifcfg-eth0
> > file in order to rebuild /etc/resolv.conf according to the local network
> > i am connecting to (university, work, hotel...).
> >
> > Can someone give me the 'clean' way of doing this at install-time with
> > kickstart ?
> > Should i use a post-install script that appends directly
> > PEERDNS=yes
> > in /etc/sysconfig/network-scripts/ifcfg-eth0 ?
> >
> > or is there a redhat-specific procedure to do this automatically at
> > install-time.
> >
> > Nicolas.
> >
> > (of course, i know how to do this using neat or
> > redhat-configure-network-gui, but this is not an option for automatically
> > installing tens of laptops).
>
> If you're getting your systems are getting their IP addresses via DHCP in
> each of those places, you shouldn't actually have to set the "PEERDNS"
> variable, at all.  The DHCP servers should be sending the DNS server info,
> by default, and the dhcpc proces will modify the resolv.conf file as
> needed.

well, it doesn't seem to be the case :
/etc/resolv.conf is generated by the script /sbin/dhclient-script

function make_resolv_conf() {
  if [ -n "$new_domain_name" ] || [ -n "$new_domain_name_servers" ]; then
    echo '; generated by /sbin/dhclient-script' > /etc/resolv.conf
    if [ -n "$new_domain_name" ]; then
        echo search $new_domain_name >> /etc/resolv.conf
    fi
    for nameserver in $new_domain_name_servers; do
      echo nameserver $nameserver >>/etc/resolv.conf
    done
  fi
}

and this function is called only if PEERDNS is set :

  if [ "${PEERDNS}" != "no" ]; then 
    make_resolv_conf
  fi

so i HAVE to set this variable either in /etc/sysconfig/network or 
/etc/sysconfig/network-scripts/ifcfg-eth0

Nicolas


-- 
Shrike-list mailing list
Shrike-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/shrike-list

[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux