resolv.conf gets rewritten on reboot even if I chmod 444
Linux - NetworkingThis 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.
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.
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.
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.
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.
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.
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".
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.