LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-03-2006, 08:05 PM   #1
b0nd
Senior Member
 
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020

Rep: Reputation: 45
not being able to save changes in /etc/resolv.conf


Hello all,
I'm used to of vi editor.
But after making changes in /etc/resolv.conf, they are available till i don't reboot the system or i do not restart the network services (/etc/rc.d/rc.inet1 stop...../etc/rc.d/rc.inet1 start)

what could be the problem ???

regards
 
Old 03-03-2006, 08:57 PM   #2
chakkerz
Member
 
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: a few...
Posts: 654

Rep: Reputation: 32
a bunch of things. 1) you are editing the file without write permissions (which means you get an error trying to save). 2) your rc scripts regenerate the resolv.conf at boot time (unlikely) ... what is the last time the file was changed? if it is during reboot, run a

grep -R resolv.conf /etc/*

and see if anything pipes to the file, or copies over it.
 
Old 03-03-2006, 09:05 PM   #3
detpenguin
Senior Member
 
Registered: Oct 2003
Location: lost in the midwest...
Distribution: Slackware
Posts: 1,098

Rep: Reputation: 54
i had the same problem...this thread may help you out. it's how i fixed mine.
 
Old 03-03-2006, 10:47 PM   #4
b0nd
Senior Member
 
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020

Original Poster
Rep: Reputation: 45
Quote:
Originally Posted by chakkerz
a bunch of things. 1) you are editing the file without write permissions (which means you get an error trying to save). 2) your rc scripts regenerate the resolv.conf at boot time (unlikely) ... what is the last time the file was changed? if it is during reboot, run a

grep -R resolv.conf /etc/*

and see if anything pipes to the file, or copies over it.
hi,
here is the output....but i can't understand whether some script is writing /etc/resolv.conf or not

Quote:
root@bond:~# grep -R resolv.conf /etc/*
/etc/dnsmasq.conf:# somewhere other that /etc/resolv.conf
/etc/dnsmasq.conf:# /etc/resolv.conf
/etc/dnsmasq.conf:# If you don't want dnsmasq to read /etc/resolv.conf or any other
/etc/dnsmasq.conf:# If you don't want dnsmasq to poll /etc/resolv.conf or other resolv
/etc/dnsmasq.conf:# dnsmasq to read /etc/ppp/resolv.conf since dnsmasq now uses the
/etc/mutt/Muttrc:# /etc/resolv.conf.
/etc/pcmcia/network.opts: # Things to add to /etc/resolv.conf for this interface
/etc/pcmcia/network:RESOLV=/etc/resolv.conf
/etc/pcmcia/network: if [ -e /etc/dhcpc/resolv.conf ] ; then
/etc/pcmcia/network: cat /etc/dhcpc/resolv.conf >> $RESOLV.N
/etc/rc.d/rc.yp:# # the same as your DNS domainname, set in /etc/resolv.conf. The NIS
root@bond:~#

As "detpenguin" adviced i added '-R'

Quote:
echo "/etc/rc.d/rc.inet1: /sbin/dhcpcd -d -t 10 -h ${DHCP_HOSTNAME[$1]} eth${1}" | $LOGGER
/sbin/dhcpcd -d -t 10 -h ${DHCP_HOSTNAME[$1]} eth${1} -R
else
echo "/etc/rc.d/rc.inet1: /sbin/dhcpcd -d -t 10 eth${1}" | $LOGGER
/sbin/dhcpcd -d -t 10 eth${1} -R
fi
now i made changes to /etc/resolv.conf and removed the entry of one DNS.
rebooted the machine.
#cat /etc/resolv.conf ......was fine

but when i connected the machine to internet (#pppoe-start) and checked the /etc/resolv.conf again.....old entries appeared.

what should i do now ???

regards
 
Old 03-03-2006, 11:30 PM   #5
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Your "problem" is this from /usr/sbin/pppoe-connect (called by pppoe-start):
Code:
# Jigger DNS if required...
if test "$DNSTYPE" = "SERVER" ; then
    # Sorry, dude...
    rm -f /etc/resolv.conf
    ln -s /etc/ppp/resolv.conf /etc/resolv.conf
elif test "$DNSTYPE" = "SPECIFY" ; then
    # Sorry, dude...
    rm -f /etc/resolv.conf
    echo "nameserver $DNS1" > /etc/resolv.conf
    if test -n "$DNS2" ; then
	echo "nameserver $DNS2" >> /etc/resolv.conf
    fi
fi
Change in /etc/ppp/pppoe.conf this stuff:
Code:
# DNS type: SERVER=obtain from server; SPECIFY=use DNS1 and DNS2;
# NOCHANGE=do not adjust.
DNSTYPE=SPECIFY

# Obtain DNS server addresses from the peer (recent versions of pppd only)
# In old config files, this used to be called USEPEERDNS.  Changed to
# PEERDNS for better Red Hat compatibility
PEERDNS=yes

DNS1=
DNS2=
Put your dns servers in DNS1 and DNS2

Or, instead of editing it manually, use pppoe-setup again, and choose to specify DNS servers.

Last edited by gbonvehi; 03-03-2006 at 11:34 PM.
 
Old 03-03-2006, 11:43 PM   #6
chakkerz
Member
 
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: a few...
Posts: 654

Rep: Reputation: 32
gbonvehi looks like he got the answer ... that has a lot of potential i think.

So take a look at his solution. If that doesn't work out, then i would consider looking at those two lines you found in your /etc:

/etc/pcmcia/network: if [ -e /etc/dhcpc/resolv.conf ] ; then
/etc/pcmcia/network: cat /etc/dhcpc/resolv.conf >> $RESOLV.N
 
Old 03-03-2006, 11:48 PM   #7
b0nd
Senior Member
 
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020

Original Poster
Rep: Reputation: 45
Thanks gbonvehi.
It worked.

i edited the file /etc/ppp/pppoe.conf and replaced the old DNS with a new one.

regards
 
  


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
resolv.conf Snump Mandriva 54 10-31-2004 04:16 PM
resolv.conf?? wrat Linux - Newbie 3 06-14-2004 04:37 PM
resolv.conf ricemark20 Linux - Networking 12 11-11-2003 04:08 PM
resolv.conf dnsbum Linux - Networking 1 10-21-2003 12:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:47 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration