Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
| 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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-01-2009, 12:38 PM
|
#1
|
|
LQ Newbie
Registered: Mar 2006
Distribution: u-lite, macpup opera
Posts: 16
Rep:
|
resolv.conf gets rewritten on reboot even if I chmod 444
my rounter causes puppy to write an improper dns entry in resolv.conf. Consequently I have to manually write it, then I have to place a command on it to make sure it doesn't get rewritten on boot, or after a couple of hours use. I had this problem with xubuntu as well. This kind of describes the problem.
https://answers.launchpad.net/ubuntu/+question/3674
I solved this problem in ubuntu by using the chattr command.
http://ubuntuforums.org/archive/index.php/t-187042.html
Puppy won't let me do this. When I use the chattr +i /etc/resolv.conf, it gives me this error.
chattr: Inappropriate ioctl for device while reading flags on /etc/resolv.conf
#
I tried chmod 444 but it had no effect on reboot. resolv.conf was rewritten again.
How can I make sure this file does not get rewritten. Why won't chattr work?
Last edited by noalternative; 12-01-2009 at 02:39 PM.
|
|
|
|
12-01-2009, 01:34 PM
|
#2
|
|
Senior Member
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571
Rep:
|
Quote:
Originally Posted by noalternative
...
I tried cmod 444 but it had no effect on reboot. resolv.conf was rewritten again.
|
Do please right after reboot: ls -la /etc/resolv.conf
|
|
|
|
12-01-2009, 02:38 PM
|
#3
|
|
LQ Newbie
Registered: Mar 2006
Distribution: u-lite, macpup opera
Posts: 16
Original Poster
Rep:
|
Quote:
Originally Posted by nimnull22
Do please right after reboot: ls -la /etc/resolv.conf
|
This was the output and yes it was still rewritten!
# ls -la /etc/resolv.conf
-r--r--r-- 1 root root 110 2009-12-01 14:30 /etc/resolv.conf
|
|
|
|
12-01-2009, 03:08 PM
|
#4
|
|
Senior Member
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571
Rep:
|
I think that resolv.conf can be overwritten only by DHCP daemon, witch I think starts at the boot time.
Check it.
|
|
|
|
12-01-2009, 03:13 PM
|
#5
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Root can still change the file. You can run "chattr +i /etc/resolv.conf" to prevent it. It would be better to change your configuration so that the dhcp client daemon doesn't modify resolv.conf.
|
|
|
|
12-01-2009, 07:19 PM
|
#6
|
|
LQ Newbie
Registered: Mar 2006
Distribution: u-lite, macpup opera
Posts: 16
Original Poster
Rep:
|
Quote:
Originally Posted by jschiwal
Root can still change the file. You can run "chattr +i /etc/resolv.conf" to prevent it. It would be better to change your configuration so that the dhcp client daemon doesn't modify resolv.conf.
|
How do I modify the dhcp client?
|
|
|
|
12-01-2009, 07:27 PM
|
#7
|
|
Member
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 13.37
Posts: 535
Rep:
|
It depends on which client you use. On mine, it's -R
The man pages would be a good place to start.
Cheers.
|
|
|
|
12-01-2009, 07:34 PM
|
#8
|
|
Senior Member
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571
Rep:
|
Quote:
Originally Posted by jschiwal
You can run "chattr +i /etc/resolv.conf" to prevent it. It would be better to change your configuration so that the dhcp client daemon doesn't modify resolv.conf.
|
Have you try "chattr +i /etc/resolv.conf", did it helps?
To modify DHCP client you need to find out which dhcp client is it.
Then you need to find script which starts dhcp client.
Then you can read in manual page additional option, for example for dhcpcd it will be "dhcpcd -R". Then you just add that option to the startup script.
Or you can find *.cfg file for your dhgp client.
For example in OpenSuse I have in /etc/sysconfig/network/dhcp, where I can add option
"-R".
Last edited by nimnull22; 12-01-2009 at 07:50 PM.
|
|
|
|
12-02-2009, 02:53 PM
|
#9
|
|
LQ Newbie
Registered: Mar 2006
Distribution: u-lite, macpup opera
Posts: 16
Original Poster
Rep:
|
Quote:
Originally Posted by nimnull22
Have you try "chattr +i /etc/resolv.conf", did it helps?
Yes, as I stated in the original post, I get an error message when I try chattr.
To modify DHCP client you need to find out which dhcp client is it.
Then you need to find script which starts dhcp client.
Then you can read in manual page additional option, for example for dhcpcd it will be "dhcpcd -R". Then you just add that option to the startup script.
Or you can find *.cfg file for your dhgp client.
For example in OpenSuse I have in /etc/sysconfig/network/dhcp, where I can add option
"-R".
|
I have puppy. Anyone know where dhcp would be on puppy.
|
|
|
|
12-02-2009, 03:37 PM
|
#10
|
|
Senior Member
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571
Rep:
|
from root console: "find / -name dhcp" without ""
|
|
|
|
12-02-2009, 11:40 PM
|
#11
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
I don't know which of 3 DHCPC clients that puppy uses. And even for a certain distro, settings and configurations change with the version. I used to have a dhcpcd.conf file which I don't any more. If your system uses netconf, then look in it's config file for the setting "NETCONFIG_DNS_STATIC_SERVERS=". Also grep the config files in /etc/ for "resolv.conf".
Someone with puppy linux would be better able to point you to the right configuration file and setting.
|
|
|
|
12-03-2009, 02:09 AM
|
#12
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
You probably use either the dhcpcd or dhclient programs. According to this site: http://puppylinux.org/wikka/dhcpcd it uses dhcpcd, and it is preinstalled.
Try the Menu -> Setup -> Network wizard first. It may have the option you are looking for. Otherwise, look through your startup scripts and config files in /etc/. Many config files have their own manpages as well, and may be modified to better suit puppy linux. Look in /etc/sysconfig/network/dhcpd if it exists. There may be a line like DHCPCD_USER_OPTIONS="" where you can add the --nodns option already mentioned. You will need to explore your system here if a google search doesn't turn up an option. Setting the -i attribute of /etc/resolv.conf could be a temporary fix until you find the proper solution.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12: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
|
|