LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 03-18-2004, 02:07 PM   #1
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
pppd: nameserver -> /etc/resolv.conf ??


I have been running Mandrake 9.1 for almost a year, and love it.

I managed to set up my internet connection with an Alcatel USB ADSL modem and it has worked brilliantly most of the time. When it doesn't work it is because I am not able to do DNS lookups, and I get "Host not found". Not the modem's fault I know!

When I look at /var/log/messages I can see that pppd is telling me that my ISP has allocated me an IP address and Primary and Secondary DNS addresses, however, the DNS addresses that I am allocated change from time to time. No doubt that is why they are telling me what they are.

I can fix the problem by looking at /var/log/messages to see what DNS www.xxx.yyy.zzz I have been allocated and manually adding that to the (growing) list of nameservers in /etc/resolv.conf. But why isn't this being done automatically? It is beginning to annoy me. I know I must have something, somewhere set up wrong, but am not sure where to start looking.

Any pointers would be appreciated. Oh, and while I am taxing your brains, why is the first line in /etc/resolv.conf:

"nameserver 127.0.0.1" ? (without the quotes!)

Thanks.
 
Old 03-18-2004, 02:29 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,533

Rep: Reputation: 148Reputation: 148
Remove the first line. Without quotes it means that your machine is a nameserver. It probably isn't, so the like can only slow things down.

There's pppd option 'usepeerdns'. Do you have it set? It says pppd to ask peer (server) for DNSes and use them.
 
Old 03-18-2004, 04:03 PM   #3
charon79m
Member
 
Registered: Oct 2003
Distribution: Just about anything... so long as it is Debain based.
Posts: 297

Rep: Reputation: 30
HATE isp's like that....

My ISP's name servers would go down and change all the time. I got sick of it and just statically pointed my /etc/resolv to name servers I knew I could rely on. (My work's public name servers.) With a little digging you can find lots of public name servers that are up all the time and willing to resolve anything you throw at it.

I havn't had a problem since.

Cheers,

MrKnisely
 
Old 03-18-2004, 04:24 PM   #4
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Original Poster
Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
Mara,

Thanks, I'll take out the first line.

usepeerdns is in the file /etc/ppp/peers/adsl, is this supposed to update resolv.conf with the current nameserver(s)?

Charon79m,
Thanks for the tip and I understand, but this is annoying me and I'd like to be able to fix it.
 
Old 03-19-2004, 05:43 AM   #5
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Original Poster
Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
Follow-up: I think I have fixed it.

pppd has the option usepeerdns enabled. It puts the two nameservers supplied by my ISP into the file /etc/ppp/resolv.conf, but doesn't update /etc/resolv.conf

So I did the following:
su root
# cd /etc
# rm resolv.conf
# ln -s /etc/ppp/resolv.conf

This seems to have fixed it.
Thanks for the pointer Mara.
 
Old 03-20-2004, 10:10 AM   #6
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,533

Rep: Reputation: 148Reputation: 148
Nice that you have it working.
 
Old 03-21-2004, 07:45 AM   #7
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Original Poster
Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
Thanks Mara, but my fix (making that link) didn't survive a reboot: Mandrake 9.1 overwrote my link to /etc/ppp/resolv.conf with a new /etc/resolv.conf that started with the line
nameserver 127.0.0.1
and then added two (wrong) nameservers.

Much googling later I found this thread http://www.ussg.iu.edu/hypermail/lin...02.1/0146.html

Which says to edit two files in /etc/ppp called ip-up.local and ip-down.local
I did not have these files, so I created them ( and, incidentally chmod 755 them! )

FYI the files are:

if-up.local

#!/bin/bash
# copied from http://www.ussg.iu.edu/hypermail/lin...02.1/0146.html
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


if-down.local

#!/bin/bash
# copied from http://www.ussg.iu.edu/hypermail/lin...02.1/0146.html
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


The correct entries for nameservers are now put in /etc/resolv.conf and I no longer have the (unnecessary) nameserver 127.0.0.1 as the first entry.
I hope this is the end of this thread!
 
  


Reply


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
Who changes /etc/resolv.conf? lmp Debian 4 11-29-2005 08:08 AM
How to specify a default nameserver in /etc/resolv.con libregeek Linux - Networking 6 11-19-2005 11:41 AM
resolv.conf albundy Linux - Software 5 12-14-2004 03:12 PM
nameserver problem on redhat 8.0 using PPPD mattkat Linux - Networking 3 01-29-2004 08:22 AM
resolv.conf ricemark20 Linux - Networking 12 11-11-2003 04:08 PM


All times are GMT -5. The time now is 06:25 PM.

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