I use my RedHat 6.1 machine to connect to multiple ISPs which have different name servers. Each one has its own PPP interface. Unfortunately, there is no apparent way to select different name servers for each interface. Here is are two small patches for ifup-ppp and ifdown-ppp which allow you to do this. If DNSSRVS is defined in ifcfg-pppX, then these servers are added to /etc/resolv.conf when the device is brought up. The DNSSRVS variable is used for the same thing in the PCMCIA package. Craig diff -u ifup-ppp.orig ifup-ppp --- ifup-ppp.orig Tue Nov 9 23:44:26 1999 +++ ifup-ppp Tue Nov 9 23:45:32 1999 @@ -75,6 +75,20 @@ chatdbg="-v" fi +# Set up DNS resolver +RESOLV=/etc/resolv.conf +if [ -n "$DNSSRVS" ]; then + cp $RESOLV $RESOLV.N + echo "# $DEVICE begin" >> $RESOLV.N + test "$DOMAIN" && echo "domain $DOMAIN" >> $RESOLV.N + test "$SEARCH" && echo "search $SEARCH" >> $RESOLV.N + for DNS in $DNSSRVS ; do + echo "nameserver $DNS" >> $RESOLV.N + done + echo "# $DEVICE end" >> $RESOLV.N + mv $RESOLV.N $RESOLV +fi + if [ -z "$WVDIALSECT" ] ; then CHATSCRIPT=/etc/sysconfig/network-scripts/chat-$DEVNAME [ -f $CHATSCRIPT ] || { diff -u ifdown-ppp.orig ifdown-ppp --- ifdown-ppp.orig Tue Nov 9 23:41:39 1999 +++ ifdown-ppp Tue Nov 9 23:43:18 1999 @@ -9,6 +9,14 @@ file=/var/run/pppwatch-$DEVICE.pid +RESOLV=/etc/resolv.conf +# Remove nameservers +if fgrep -q "# $DEVICE begin" $RESOLV ; then + sed -e "/# $DEVICE begin/,/# $DEVICE end/d" \ + < $RESOLV > $RESOLV.N + mv $RESOLV.N $RESOLV +fi + if [ ! -f $file ]; then # ppp isn't running, or we didn't start it exit 0
This is already done for you, set DNS1=foo and DNS2=bar in your /etc/sysconfig/network-scripts/ifcfg-* files and your /etc/resolv.conf file will be munged appropriately.