Re: How to receive DNS IP with a Linux PPP dialup?

From: Petr Sebor (petr@scssoft.com)
Date: Fri Feb 11 2000 - 06:24:51 EST


I believe this is possible from pppd v 2.3.6 or so ... Look at the
option 'usepeerdns'

You can add 'usepeerdns' into you /etc/ppp/options file and then
add this into /etc/ppp/ip-up.local

if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
        rm -f /etc/ppp/resolv.prev
        if [ -f /etc/resolv.conf ]; then
                cp /etc/resolv.conf /etc/ppp/resolv.prev
                grep search /etc/ppp/resolv.prev > /etc/resolv.conf
                grep nameserver /etc/ppp/resolv.prev >> /etc/resolv.conf
                cat /etc/ppp/resolv.conf >> /etc/resolv.conf
        else
                cp /etc/ppp/resolv.conf /etc
        fi
        chmod 644 /etc/resolv.conf
fi

AND this into ip-down.local to restore the original state

if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
        if [ -f /etc/ppp/resolv.prev ]; then
                cp -f /etc/ppp/resolv.prev /etc/resolv.conf
        else
                rm -f /etc/resolv.conf
        fi
        chmod 644 /etc/resolv.conf
fi

---- I believe the sample script is a part of pppd distribution

Regards,
Petr

--
Petr Sebor
Technology/Engine Development
SCS Software [ http://www.scssoft.com ]

----- Original Message ----- From: Henrique Pantarotto <scanner@cepa.com.br> To: <linux-net@vger.rutgers.edu>; <henpa@zaz.com.br> Sent: Friday, February 11, 2000 3:22 AM Subject: How to receive DNS IP with a Linux PPP dialup?

> Hello Linux friends, > > when I dial to my ISP using my Linux box, is it possible to receive the > DNS server automatically, just like Windows users do? > > I read at the PPP Howto and ppp man that pppd doesn't do that. And I > wonder: WHY NOT? Is it that hard? I've searched for this question in > many archives and also from altavista, but I found no answer. > > In this specific situation, I can not set the "/etc/resolv.conf" file > manually. It really has to be done automatically (it can be added to > resolv.conf using a script or whatever). > > I always like to think that "everything is possible with Linux", so it > must be possible. ;-) > > Are there other choices to do dialup connections with Linux other than > pppd? (console apps that is). > > > Thanks, > > Henrique Pantarotto > > > - > To unsubscribe from this list: send the line "unsubscribe linux-net" in > the body of a message to majordomo@vger.rutgers.edu >

- To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.rutgers.edu



This archive was generated by hypermail 2b29 : Tue Feb 15 2000 - 21:00:36 EST