Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-03-2006, 08:05 PM
|
#1
|
Senior Member
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020
Rep:
|
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
|
|
|
03-03-2006, 08:57 PM
|
#2
|
Member
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: a few...
Posts: 654
Rep:
|
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.
|
|
|
03-03-2006, 09:05 PM
|
#3
|
Senior Member
Registered: Oct 2003
Location: lost in the midwest...
Distribution: Slackware
Posts: 1,098
Rep:
|
i had the same problem... this thread may help you out. it's how i fixed mine.
|
|
|
03-03-2006, 10:47 PM
|
#4
|
Senior Member
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020
Original Poster
Rep:
|
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
|
|
|
03-03-2006, 11:30 PM
|
#5
|
Senior Member
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145
Rep:
|
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.
|
|
|
03-03-2006, 11:43 PM
|
#6
|
Member
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: a few...
Posts: 654
Rep:
|
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
|
|
|
03-03-2006, 11:48 PM
|
#7
|
Senior Member
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020
Original Poster
Rep:
|
Thanks gbonvehi.
It worked.
i edited the file /etc/ppp/pppoe.conf and replaced the old DNS with a new one.
regards
|
|
|
All times are GMT -5. The time now is 09:47 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|