OPNsense Forum

English Forums => General Discussion => Topic started by: bobbis on May 21, 2020, 05:56:29 am

Title: How to prevent unbound from updating/overwriting /etc/resolv.conf ?
Post by: bobbis on May 21, 2020, 05:56:29 am
Hello

is it possible to prevent unbound to updating or overwriting the /etc/resolv.conf ? I had no luck while i try to set under Unbound->General->Custom options from the WebUI.

Code: [Select]
resolve_conf="/dev/null"
resolve_conf="none"
resolve_conf: "/dev/null"
resolve_conf: "none"
resolve_conf: none

It doesnt matter wich line from the code i used into the unbound custom option. Is one line of code above is written into custom options, unboud doesn't (re)start.

What is the correct option to prevent unbound from updating or overwriting /etc/resolv.conf ?
bobbis
Title: Re: How to prevent unbound from updating/overwriting /etc/resolv.conf ?
Post by: mimugmail on May 21, 2020, 07:10:40 am
Why do you want to stop this?
Title: Re: How to prevent unbound from updating/overwriting /etc/resolv.conf ?
Post by: bobbis on May 21, 2020, 07:33:00 am
I want to add "custom" options entrys into /etc/resolv.conf file!...

man resolv.conf (https://www.freebsd.org/cgi/man.cgi?resolv.conf)
Title: Re: How to prevent unbound from updating/overwriting /etc/resolv.conf ?
Post by: mimugmail on May 21, 2020, 04:06:27 pm
Couldnt you achieve the same when just using Unbound?
Title: Re: How to prevent unbound from updating/overwriting /etc/resolv.conf ?
Post by: bobbis on May 21, 2020, 09:35:24 pm
/usr/local/etc/inc/system.inc on line 191 change:
Code: [Select]
        rename($tempfile, '/etc/resolv.conf');
to this.
Code: [Select]
    if (!file_exists('/etc/resolv.conf')) {
        rename($tempfile, '/etc/resolv.conf');
    }