Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 02-27-2006, 07:52 AM   #16
Senior Member
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,603

Rep: Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509Reputation: 1509

I have been looking at this problem as I have an ISP who firmly supports the Windows world and thinks nothing of changing DNS server addresses without notification. I offer the following hack which will work for a home user dialling out to an ISP:

1. If you add 'usepeerdns' to your /etc/ppp/options, then when pppd is started at the CLI by 'ppp-go' and pppd connects it will create a /etc/ppp/resolv.conf file. This file contains nameserver lines with the DNS server addresses that your ISP offers. Note that pppd must be started by root or pppd set to run as an suid program (like kppp) for this to occur. 'man pppd' will give further details.

2. To add the nameserver lines to your /etc/resolv.conf, you can add these lines to your /etc/ppp/ip-up script.

# /etc/resolv.conf contains a single line like 'search'
# Save a copy for later restoration by /etc/ppp/ip-down script
cp /etc/resolv.conf /etc/resolv.conf.orig
# Add the nameserver lines containing DNS server addresses to /etc/resolv.conf
cat /etc/ppp/resolv.conf >> /etc/resolv.conf

3. You must also clean up the altered /etc/resolv.conf when the ppp link is shutdown at the CLI using 'ppp-off'. This can be done by adding these lines to your /etc/ppp/ip-down script.

# Restore the original file that was altered by /etc/ppp/ip-up script
cp /etc/resolv.conf.orig /etc/resolv.conf

4. The above works for the root user, who has privileges to write to the /etc directory and to /etc/resolv.conf. To make this work for ordinary users requires making pppd an suid program.
Old 02-28-2006, 01:12 AM   #17
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,855

Rep: Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547
I applaud your efforts to get the two config/connection methods to work together. Just want to point out that once you have an /etc/resolv.conf with DNS entries, when you connect your connection is not dynamically allocated. Instead pppd uses the addresses you gave it. No problem if you always use the same DNS servers.
If you manually edit your ppp scripts to create dynamic DNS server connection, then you just need to put 'usepeerdns' in your /ettc/ppp/options file and remove /etc/resolv.conf. When you connect, pppd will generate the /etc/ppp/resolv.conf with the currently allocated addresses. Many ISP's will time you out if your connection is inactive for awhile and your DNS address becomes stale. That's why there are lines in /etc/ppp/ip-up that will 'ping' your connection every few minutes -to keep the DNS addresses 'alive'.
The stuff in ip-down is just to clean up after the connection is down so that you start fresh next time, with truly dynamic DNS allocation. I wrote ISPSETUP when I was using a net-by-call dialup connection and never knew what my DNS addresses would be.

If your using ppp-on and ppp-off just so that you can control ppp from the command line, it seems better to use the command-line options for kppp as mentioned above, after doing the configuration with kppp.
Old 02-28-2006, 07:41 AM   #18
LQ Newbie
Registered: Dec 2005
Posts: 12

Original Poster
Rep: Reputation: 0

I thank you for your suggestion. I tried it, and it didn't work. I unaliased "cp" to eliminate any wait for a response, and subsequent by-pass, but to no avail. My original solution still works fine for me, and I'll stick with it.

Thanks for the effort.

Old 03-01-2006, 06:29 AM   #19
LQ Newbie
Registered: Dec 2005
Posts: 12

Original Poster
Rep: Reputation: 0

I tried once, via the command line instruction "kppp --help" / "kppp -c IP Acct. Name" - thea works from the command line (via "Alt-F2") , as long as I'm in the GUI window or have it open. "kppp -q (+ or - theIP acc. name) doesn't work at all to quit. You refer to "kppp command line options above" in your response, but I could not find them.

Thanks for your response.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
problems with pppsetup somnambulist Linux - Software 1 02-22-2006 02:50 PM
DNS nameserver issue - pppsetup the_rydster Slackware 2 03-04-2004 09:09 AM
pppsetup v. KPPP in dial-up use rich442 Slackware 7 04-15-2003 07:27 PM
kppp and pppsetup in Slackware hkslacker Slackware 4 02-11-2003 11:29 AM
pppsetup php Linux - General 3 12-30-2001 02:40 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:32 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration