LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   resolv.conf file (https://www.linuxquestions.org/questions/debian-26/resolv-conf-file-270496/)

hraposo 12-26-2004 11:25 AM

resolv.conf file
 
How I put a nameserver in resolv.config, that's is not change any time I reboot the machine, in debian?
How can I deny that the machine change what I write in resolv.conf file?

Linux.tar.gz 12-26-2004 11:45 AM

A workaround can be:
You put in rc.local a command which copy a working resolv.conf.whatever to resolv.conf.
Rc.local don't exist in Debian, but you can create it easily.

hraposo 12-26-2004 12:26 PM

and where I create this rc.local?
and what kind of commands I put in this file?

hraposo 12-26-2004 12:54 PM

I create a file in home with name
resolv.config
nameserver 194.65.100.117
nameserver 194.65.5.2

that I create anather file executable with name
dns (whit this commands:
###script para dns###
rm -rf /etc/resolv.conf
cp /home/helder/resolv.conf /etc/

when I do as #./dns the resolv.conf change, and all works

Now, where I create rc.local to automatize that

Linux.tar.gz 12-26-2004 06:50 PM

Create a file /etc/init.d/local, with this inside:
#!/bin/sh

then
chmod 755 /etc/init.d/local
update-rc.d local start 98 2 3 4 5 . <--- don't forget the dot
mkdir /etc/rc.d/
ln -s /etc/init.d/local /etc/rc.d/rc.local

Tested and approved.
Lamed from here:
http://www.trustonme.net/didactels/81.html#local

aexl 12-27-2004 05:22 AM

I had the same problem. I think it was bootscript that had overwritten the resolv.conf file everytime I started the system.


All times are GMT -5. The time now is 11:00 PM.