LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   /etc/resolv.conf being overwritten... (https://www.linuxquestions.org/questions/slackware-14/etc-resolv-conf-being-overwritten-312465/)

detpenguin 04-12-2005 12:56 PM

/etc/resolv.conf being overwritten...
 
running slack10 on a DSL, actiontec modem...for whatever reason, the modem passes bad DNS numbers....so i edited my /etc/resolv.conf file with the right ones, and it works great. only problem is, when i reboot, it rewrites resolv.conf with the bad numbers again...is there any way to make it so my /etc/resolv.conf DOESN'T get re-written?

i found this thread which had some suggestions...including an -R flag, but it's not really helping me out, so maybe it's not applicable in slack? any suggestions are greatly appreciated. i know it's not a huge deal to quickly modify the file, but it would be nice to NOT have to do that....

TIA

jay

jtshaw 04-12-2005 01:00 PM

In your rc.inet1 script where it calls dhcpcd add the -R option to it.

-R prevents resolv.conf from being replaced
-N prevents ntp.conf from being replaced
-Y prevents yp.conf from being replaced

See man dhcpcd for more options.


EDIT:
Lines 75 and 78 of the /etc/rc.d/rc.inet1 file are where dhcpcd is actually executed in the default Slackware 10.1 configuration. That is where you will need to add the -R flag.

detpenguin 04-12-2005 01:15 PM

Quote:

Originally posted by jtshaw
In your rc.inet1 script where it calls dhcpcd add the -R option to it.

-R prevents resolv.conf from being replaced
-N prevents ntp.conf from being replaced
-Y prevents yp.conf from being replaced

See man dhcpcd for more options.


EDIT:
Lines 75 and 78 of the /etc/rc.d/rc.inet1 file are where dhcpcd is actually executed in the default Slackware 10.1 configuration. That is where you will need to add the -R flag.

i've added the -R flag as such:
Code:

/sbin/dhcpcd  -d -t 10 -h  ${DHCP_HOSTNAME[$1]} eth${1} -R
Code:

/sbin/dhcpcd  -d -t 10 eth${1} -R
but when i reboot, it doesn't create the /etc/resolv.conf file...do i need to manually create it? or am i adding the -R flag in the wrong place....

jtshaw 04-12-2005 01:26 PM

You will need to create it manually.

detpenguin 04-12-2005 01:42 PM

it worked!!! thanks so much, shaw...:)


All times are GMT -5. The time now is 07:21 AM.