(This is being resent because it was mercilessly bounced... :( )

[EMAIL PROTECTED] writes:

> *- Damon Muller wrote about "resolv.conf, PPP and multiple providers"
> | 
> | However, anyone have any hints on how to set up the resolv.conf file
> | when you have multiple ISPs? I guess I could have an ip-up script modify
> | it when it dials each ISP, but that's a bit of a pain.
> | 
> 
> That is about the only way to do it.  Read
> /usr/doc/HOWTO/mini/Dynamic-IP-Hacks.gz.  It is a little out of date
> but it has some good ideas.  Another file to modify is /etc/hosts.

Note that under Debian 2.0, /etc/ppp/ip-up is a script that runs every 
file under /etc/ppp/ip-up.d/ - so if you want to add something it's
easiest to do it by adding a new file to that directory (note that the 
filename must only contain the alphanumeric characters and
underscore(_) ).

On simple way to do this is:

#!/bin/bash
get_ns () {
  case "$PPP_REMOTE" in
    128.220.222.2)  echo "128.220.2.7 128.220.2.82" ;;
    137.22.*) echo "137.22.1.13 137.22.1.15 137.22.1.4" ;;
    203.20.*) echo "203.20.80.1 203.34.5.3" ;;
  esac
}
echo -n > /etc/resolv.conf
# Next line optional
echo "search empire.net.au" >> /etc/resolv.conf
for ns in `get_ns`; do echo "nameserver $ns" >> /etc/resolv.conf; done

Reply via email to